问题描述:
ImportError: dlopen(/Users/squirrel/anaconda/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.7.5.dylib
Referenced from: /Users/squirrel/anaconda/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
在 OS X El Capitan 中有一个跟安全相关的模式叫 SIP(System Integrity Protection ),它禁止让软件以 root 身份来在 Mac 上运行,在升级到 OS X 10.11 中或许你就会看到部分应用程序被禁用了。
所以https://github.com/tensorflow/tensorflow/issues/3991中是这么说的:
I've seen similar issue with SIP. Was getting "@rpath/libcudart.7.5.dylib" error, disable SIP, it started working. Upgraded El Capitan (this re-enabled SIP), it stopped working. Disabled SIP, started working again.
可以参考一下网址进行尝试安装
【http://stackoverflow.com/questio ... orflow-error-on-mac】
具体解释以及方法如下:
This error message is displayed if you install the GPU-enabled Mac OS version of TensorFlow (available from release 0.10 onwards) on a machine that does not have CUDA installed.
To fix the error, install the CPU version for Python 2.7 or 3.x, as follows:
# Mac OS X, CPU only, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0rc0-py2-none-any.whl
$ sudo pip install --upgrade $TF_BINARY_URL
# Mac OS X, CPU only, Python 3.4 or 3.5:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0rc0-py3-none-any.whl
$ sudo pip3 install --upgrade $TF_BINARY_URL