bazel 构建 tensorflow 服务错误

bazel building tensorflow serving error

我是运行一个tensorflow serving container 参考这个,前面的步骤都很好,但是在最后一块遇到了一些问题:

 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: file '@bazel_tools//tools/cpp:cc_configure.bzl' does not contain symbol 'cc_autoconf_impl'. ERROR: error loading package '': Extension file 'third_party/clang_toolchain/cc_configure_clang.bzl' has errors. ERROR: error loading package '': Extension file 'third_party/clang_toolchain/cc_configure_clang.bzl' has errors. INFO: Elapsed time: 0.107s ERROR: Couldn't start the build. Unable to run tests. And in my container, the bazel version is 0.9.0:

我刚遇到这个错误。首先请输入命令 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

我已经在 github 上回答过这个问题并且它有效。请参考链接https://github.com/tensorflow/serving/issues/851 and https://github.com/tensorflow/serving/issues/854