bazel building tensorflow服务错误

时间:2018-04-16 09:55:02

标签: bazel tensorflow-serving

我正在运行一个tensorflow服务容器,参考这个,所有前面的步骤都很好,但在最后一个块我遇到了一些问题:

 git clone --recurse-submodules https://github.com/tensorflow/serving
 cd serving/
 bazel build -c opt tensorflow_serving/...




 root@15bb1c2766e3:/serving# bazel build -c opt tensorflow_serving/...

错误:

  

/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/third_party/clang_toolchain/cc_configure_clang.bzl:3:1:   文件'@bazel_tools // tools / cpp:cc_configure.bzl'不包含   符号'cc_autoconf_impl'。错误:错误加载包'':扩展名   文件'third_party / clang_toolchain / cc_configure_clang.bzl'有错误。   错误:错误加载包'':扩展文件   'third_party / clang_toolchain / cc_configure_clang.bzl'有错误。信息:   经过时间:0.107秒错误:无法启动构建。无法运行   试验。在我的容器中,bazel版本是0.9.0:

1 个答案:

答案 0 :(得分:1)

我刚遇到这个错误。首先,请输入命令bazel version来检查您的Bazel版本是否为0.5.4。

如果bazel版本为0.5.4,则需要将其升级到0.12.0。要进行更新,您可以将Dockerfile.devel BAZEL_VERSION更改为0.12.0并重新运行所有步骤。

或者您可以通过

直接在docker容器中更新bazel
  1. 从下载bazel--installer-linux-x86_64.sh https://github.com/bazelbuild/bazel/releases位置
  2. chmod + x ./bazel--installer-linux-x86_64.sh
  3. ./ bazel--installer-linux-x86_64.sh
  4. 我已经在github上回答了这个问题,但它确实有效。请参阅链接https://github.com/tensorflow/serving/issues/851https://github.com/tensorflow/serving/issues/854