【问题标题】:bazel installation to version 0.5.4 or higher to build TensorFlowbazel 安装到版本 0.5.4 或更高版本以构建 TensorFlow
【发布时间】:2017-10-18 20:30:43
【问题描述】:

我正在使用docker build --pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel . 使用docker build --pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel . 为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 支持的标签?

【问题讨论】:

  • 你在哪个平台上?您是如何安装 Bazel 的——您是从 Bazel 的 Github 页面下载安装程序(.sh 文件),您是使用包管理器还是从源代码构建?
  • @László 平台在 Windows 10 上。正在从 (github.com/tensorflow/serving/blob/master/tensorflow_serving/…) 中提取 Bazel 安装,其中包含 bazel 设置。
  • 谢谢!当您写“尝试更新 bazel 只会给我相同的版本号 0.5.1”时。 -- 你的意思是你编辑了 Dockerfile 并且仍然得到 0.5.1 吗?在那种情况下,我相信这不是 Bazel 错误。不过,我也无法帮助 Docker :(
  • 看起来这应该在github.com/tensorflow/serving/commit/… 中得到修复。希望开发 docker 镜像现在已经更新了吗?

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


【解决方案1】:

即使我想要用于 tensorflow 0.8 的 0.5.4 版本的 bazel。 试过brew install bazel@0.5.1。没用。。

所以,我从 bazel git release 下载了 bazel 0.5.4 版本并安装如下:


  • https://github.com/bazelbuild/bazel/releases 下载 bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
  • 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

【讨论】:

    猜你喜欢
    • 2020-12-10
    • 2017-08-19
    • 1970-01-01
    • 2019-02-27
    • 2019-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-21
    相关资源
    最近更新 更多