我正在尝试按照TensorFlow安装文档在Mac上设置TensorFlow .
但是,在完成概述的步骤并尝试" import tensorflow as tf"后,我得到以下错误跟踪:
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 21, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow')
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _pywrap_tensorflow
Run Code Online (Sandbox Code Playgroud)
我之前已经在我的机器上安装和使用过TensorFlow,但从未遇到过这个问题.
这部分看起来是错误的:
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow')
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
Run Code Online (Sandbox Code Playgroud)
它使用pywrap_tensorflow来自 Python 安装的版本,/usr/local/lib/python2.7但importlib来自 的版本/usr/local/Cellar/python/2.7.9。
你的Python包搜索路径肯定有问题。请参阅Keras 导入错误 Nadam以获取故障排除提示。
| 归档时间: |
|
| 查看次数: |
9208 次 |
| 最近记录: |