从源构建TensorFlow时出错

TSR*_*TSR 3 compiler-errors bazel tensorflow

我试图在本教程之后在Debian OS上从源代码构建TensorFlow cpu r1.11:https://www.tensorflow.org/install/source

按照建议使用本教程https://docs.bazel.build/versions/master/install-ubuntu.html 从二进制安装程序中安装了bazel .

然后我按照每一步,一切正常,直到这个命令:

bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/lite/...
Run Code Online (Sandbox Code Playgroud)

它向我显示了这个错误:

ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
INFO: Elapsed time: 0.088s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
Run Code Online (Sandbox Code Playgroud)

我在网上看到这可能与bazel有关.所以我尝试使用Using Bazel自定义APT存储库重新安装bazel,但我得到了同样的错误.

jde*_*esa 7

从版本1.12.0开始,TensorFlow使用了一些已弃用的Bazel功能,这些功能在最近的Bazel版本中被完全删除.不要使用最新版本,请尝试使用旧版本.我能够使用Bazel 0.18.1在Windows上构建TensorFlow 1.12.0,这很可能也适用于TensorFlow 1.11.