安装tfprof命令行

时间:2018-01-24 00:06:42

标签: python tensorflow

我想使用tfprof配置我的tensorflow应用程序。我有一个运行tensorflow 1.3安装,其中缺少tfprof命令行工具。我也在本地尝试了提供的pip包,但在那里我也找不到tfprof。

有没有办法在运行的tensorflow应用程序中再次编译和链接tfprof命令行工具?

我已经git-cloned tensorflow存储库并尝试使用bazel 0.5.2构建它

$ bazel build --config opt tensorflow/core/profiler/...
WARNING: Output base '/home/USERNAME/.cache/bazel/_bazel_USERNAME/e5cce820cc082410b4fcc604db349066' is on NFS. This may lead to surprising failures and undetermined behavior.
WARNING: Config values are not defined in any .rc file: opt
ERROR: /tmp/tensorflow/tensorflow/core/BUILD:1416:1: no such target '//tensorflow/tools/git:gen/spec.json': target 'gen/spec.json' not declared in package 'tensorflow/tools/git' defined by /tmp/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /tmp/tensorflow/tensorflow/core/BUILD:1416:1: no such target '//tensorflow/tools/git:gen/head': target 'gen/head' not declared in package 'tensorflow/tools/git' defined by /tmp/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /tmp/tensorflow/tensorflow/core/BUILD:1416:1: no such target '//tensorflow/tools/git:gen/branch_ref': target 'gen/branch_ref' not declared in package 'tensorflow/tools/git' defined by /tmp/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: Analysis of target '//tensorflow/core/profiler:profiler' failed; build aborted.
INFO: Elapsed time: 167.083s

或只是复制提到的here

命令
bazel build --config opt third_party/tensorflow/core/profiler/...                                                        
WARNING: Output base '/home/USERNAME/.cache/bazel/_bazel_USERNAME/e5cce820cc082410b4fcc604db349066' is on NFS. This may lead to surprising failures and undetermined behavior.
WARNING: Config values are not defined in any .rc file: opt
ERROR: no targets found beneath 'third_party/tensorflow/core/profiler'.

2 个答案:

答案 0 :(得分:1)

我认为道路不对。如果当前目录是克隆的tensorflow存储库,则应使用路径tensorflow/core/profiler/

答案 1 :(得分:0)

从您的tensorflow目录中运行./configure脚本以设置环境变量。