bazel安装到版本0.5.4或更高版本以构建TensorFlow

时间:2017-10-18 20:30:44

标签: docker tensorflow bazel tensorflow-serving docker-container

我正在使用docker build --pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel .使用Bazel为TensorFlow构建容器,并按照此处的说明运行docker run -it $USER/tensorflow-serving-develhttps://www.tensorflow.org/serving/docker

然而,在运行./configure命令后,我收到此错误

root@4489fe3513fc:/serving/tensorflow# ./configure
Extracting Bazel installation...
You have bazel 0.5.1 installed.
Please upgrade your bazel installation to version 0.5.4 or higher to build TensorFlow!
Configuration finished
root@4489fe3513fc:/serving/tensorflow# cd ..
root@4489fe3513fc:/serving# bazel test tensorflow_serving/...
................
ERROR: /serving/WORKSPACE:23:1: Traceback (most recent call last):
        File "/serving/WORKSPACE", line 23
                tf_serving_workspace()
        File "/serving/tensorflow_serving/workspace.bzl", line 16, in tf_serving_workspace
                tf_workspace(path_prefix = "", tf_repo_name = "...")
        File "/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/workspace.bzl", line 146, in tf_workspace
                check_version("0.5.4")
        File "/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/workspace.bzl", line 56, in check_version
                fail("\nCurrent Bazel version is {}, ...))

Current Bazel version is 0.5.1, expected at least 0.5.4

尝试更新bazel只是给了我相同的版本号0.5.1。我不确定如何处理这个问题。当我尝试更新时,是否有我支持的docker支持标签?

1 个答案:

答案 0 :(得分:1)

即使我想要张量为0.8的0.5.4版本的bazel。 试过brew install bazel@0.5.1。没工作..

所以,我从bazel git发行版下载了bazel 0.5.4版本并按如下方式安装:

  • 从下载bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh https://github.com/bazelbuild/bazel/releases
  • chmod + x bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
  • ./ bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
  • 您终端中的
  • bazel version应为0.5.4

花了几分钟时间以这种方式安装它:)希望有所帮助!!

(我分享了类似的答案here