【发布时间】:2016-12-07 05:05:37
【问题描述】:
我正在使用 OS X El Capitan (10.11.4)。
我刚刚使用 pip 安装说明 here 下载了 TensorFlow。
一切都很顺利,尽管我确实收到了一些警告消息,例如:
The directory '/Users/myusername/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
和
You are using pip version 6.0.8, however version 8.1.2 is available. 虽然我刚刚安装了 pip。
然后,当我在 Python 中测试 TensorFlow 时,我得到了错误:
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/python/__init__.py", line 48, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.7.5.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
现在,当我尝试执行 pip uninstall tensorflow-0.10.0rc0 时,它告诉我它没有安装。
我发现与此问题最接近的是 TensorFlow GitHub 文档中的 this issue(我没有尝试过)。
我如何卸载它安装的任何东西并让 TensorFlow 正常运行?
【问题讨论】:
-
您是否安装了支持 GPU 的版本,但没有安装 CUDA?
-
@mrry 很有可能。什么是 CUDA?如何安装?
-
它是否告诉我在说明中的某处安装 CUDA 而我错过了?
-
@mrry 哦!我明白了,它位于标记为 (Optional, Linux) 的部分下的底部附近,所以我忽略了它。谢谢!
标签: python macos pip tensorflow osx-elcapitan