简体   繁体   中英

Can't run tensorboard because of “ Symbol not found: _PyBytes_AsString”

I've been trying to run tensoarboard without any success. I can see that the function tf.summary.FileWriter() is working since I can see that the logFile is created in the right folder. But when I run in my terminal:

    tensorboard --logdir=/private/tmp/mnist/2 --port=6006

I get :

**Traceback (most recent call last):**
**File**"/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
**File** "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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**: dlopen(/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so, 2): Symbol not found: _PyBytes_AsString
**Referenced from**: /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so
**Expected in**: flat namespace
in /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so

I don't know how to deal with the Symbol not found: _PyBytes_AsString and Expected in: flat namespace . There is this link that talks about a similar error I think but it didn't help me.

The code I used can be found on this tutorial and I'm on MacOS Sierra 10.12.1

I had same problem just like yours. In my case, I installed python, python3 packages via Homebrew on OS X 10.11.6, and I executed my project on python3.
In my opinion, the symptom of “Symbol not found” problem might be caused by that our tensorboard linked to the wrong python frameworks.
I found this issue opened at Homebrew/legacy-homebrew ' python3 framework installation incomplete? #20591 '.
Like samueljohn said that 'the Frameworks are not correctly linked into homebrew's prefix.'
So, I just followed his guidance, and created the link on my own.

brew update
brew unlink python python3
brew link python
brew link python3

Please excuse my limited English ability, but hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM