1

由于我提取了 tensorflow 存储库的最新更新,我发现 tensorboard 不再起作用。我使用 bazel-0.1.4 从源代码安装。之后,我按如下方式构建了张量板:

bazel build tensorflow/tensorboard:tensorboard

然后,当我运行它时:

bazel-bin/tensorflow/tensorboard/tensorboard

我收到错误:

Traceback (most recent call last):
File "/home/username/tensorflow/bazel-bin/tensorflow/tensorboard/tensorboard.runfiles/tensorflow/tensorboard/backend/tensorboard.py", line 36, in <module>
from tensorflow.tensorboard.backend import tensorboard_server
ImportError: cannot import name tensorboard_server

怎么了?有人能帮我吗?

4

1 回答 1

1

看起来最近的提交添加了新模块tensorboard_server,但没有将其列为 tensorboard 的依赖项。

我通过添加以下部分修改了 tensorflow/tensorboard/BUILD:

py_library(
    name = "tensorboard_server",
    srcs = ["backend/tensorboard_server.py"],
    deps = [
        ":float_wrapper",
        "//tensorflow/python:platform",
        "//tensorflow/python:summary",
    ],
    srcs_version = "PY2AND3",
)

并添加":tensorboard_server"到张量板二进制文件的依赖项中。

在此之后,我按照您的指定构建并运行了 tensorboard,它似乎可以工作:

$ bazel build tensorflow/tensorboard:tensorboard
INFO: Found 1 target...
Target //tensorflow/tensorboard:tensorboard up-to-date:
  bazel-bin/tensorflow/tensorboard/tensorboard
INFO: Elapsed time: 0.425s, Critical Path: 0.10s
$ bazel-bin/tensorflow/tensorboard/tensorboard --logdir .
Starting TensorBoard 13 on port 6006
(You can navigate to http://0.0.0.0:6006)
于 2016-02-09T15:25:19.310 回答