【问题标题】:Error while building TensorFlow from source从源代码构建 TensorFlow 时出错
【发布时间】:2019-08-27 05:54:56
【问题描述】:

我正在尝试按照本教程在 Debian 操作系统上从源代码构建 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/...

它显示了这个错误:

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)

我在网上看到这可能与 bazel 有关。所以我尝试使用 Using Bazel custom APT repository 重新安装 bazel,但我得到了同样的错误。

【问题讨论】:

  • @jdehesa 谢谢人!你解封了我。如果你能给出答案,我会标记为已解决。它可能会帮助其他人

标签: tensorflow compiler-errors bazel


【解决方案1】:

从 1.12.0 版开始,TensorFlow 使用了一些已弃用的 Bazel 功能,这些功能在最新版本的 Bazel 中已完全弃用。暂时不要使用最新版本,而是尝试使用较旧的版本。我能够使用 Bazel 0.18.1 在 Windows 上构建 TensorFlow 1.12.0,很可能也适用于 TensorFlow 1.11。

【讨论】:

  • 希望是Bazel 0.18.1 ?
  • @SathyamoorthyR 哦,是的,已修复,感谢您指出这一点。
【解决方案2】:

我同意@jdehesa。甚至我也在努力从头开始构建张量流。我尝试了不同的版本,0.26,0.21,0.19.1,最后它与 0.18.1 一起工作。所以,这是一个 bazel 问题,而不是 Tensorflow。 TF_version=1.12.0

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-11
    • 2018-02-03
    • 2016-04-13
    • 2015-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多