3

我想从源代码安装最新的 TensorFlow。我拉了存储库,然后运行

bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

我收到了这个错误:

ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: file '/tensorflow:tensorflow.bzl.bzl' was not correctly loaded. Make sure the 'load' statement appears in the global scope in your file.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:104:1: name 'tf_gen_op_wrapper_py' is not defined.
ERROR: /home/samuelchin/tensorflow/tensorflow/tools/pip_package/BUILD:13:1: Target '//tensorflow/models/embedding:package' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:build_pip_package'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.071s.
4

2 回答 2

5

最近对 TensorFlowBUILD文件的更改导致了对 Bazel 0.1.4 的依赖。这已在邮件列表中公布discuss@tensorflow.org,但尚未进入网站上的文档。

正如您已经发现的,将 Bazel 升级到0.1.4 版应该可以修复此构建错误。

于 2016-01-22T16:46:10.927 回答
1

原来 bazel 已经过时了。我的 bazel 之前的版本是 0.1.2,最后一次更新是在 12 月。从那时起,Bazel 已更新到 0.1.4。对于那些有这个错误的人来说,更新 bazel 就可以了。然后,您可以按正常方式构建。

我想将来,如果它无法构建,您可能需要检查 bazel 是否已更新到最新版本。

于 2016-01-22T07:52:51.287 回答