通过pip安装后出现Tensorboard错误

时间:2017-06-01 04:55:15

标签: python tensorflow installation tensorboard undefined-symbol

我最近尝试通过pip安装tensorboard,详见README.md。安装被认为是成功的,但是当我尝试在安装后运行tensorboard时,我继续收到导入/未定义的符号错误,如下所示。

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/tensorboard/tensorboard.py", line 32, in <module>
    from tensorflow.python.summary import event_file_inspector as efi
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/summary/event_file_inspector.py", line 122, in <module>
    from tensorflow.python.platform import gfile
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/platform/gfile.py", line 22, in <module>
    from tensorflow.python.lib.io.file_io import copy as Copy
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/lib/io/file_io.py", line 27, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyBytes_AsStringAndSize

我在安装过程中遗漏了什么吗?

我该怎么做才能解决这个问题?

谢谢!

1 个答案:

答案 0 :(得分:1)

报告

以上错误是因为使用pip3(python 3)安装了Tensorboard,并且TF env设置为python2.7。

使用pip2 install tensorboard

现在tensorboard和tf env都设置为python2