tensorflow ImportError" @rpath / libcudart.8.0.dylib"找不到图像

时间:2017-02-01 19:26:51

标签: python macos installation tensorflow

在Mac Sierra中使用cuda_gpu,python 2.7从系统默认设置尝试Tensorflow,没有虚拟环境。

在进行基本测试"导入tensorflow"

时遇到ImportError
dyld: warning, LC_RPATH $ORIGIN/../../_solib_darwin/_U@local_Uconfig_Ucuda_S_Scuda_Ccudart___Uexternal_Slocal_Uconfig_Ucuda_Scuda_Slib in /Library/Python/2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so being ignored in restricted program because it is a relative path
dyld: warning, LC_RPATH ../local_config_cuda/cuda/lib in /Library/Python/2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so being ignored in restricted program because it is a relative path
dyld: warning, LC_RPATH ../local_config_cuda/cuda/extras/CUPTI/lib in /Library/Python/2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so being ignored in restricted program because it is a relative path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 60, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: dlopen(/Library/Python/2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.8.0.dylib
  Referenced from: /Library/Python/2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
  Reason: image not found

我已经尝试过&#34; local_config_cuda&#34;来自'Library not loaded: @rpath/libcudart.7.5.dylib' TensorFlow Error on Mac的@norman_h建议,但仍无效。

CUDA示例工作,所以它看起来是lib引用的问题...可以让我流连忘返 有些轻?谢谢!

1 个答案:

答案 0 :(得分:1)

根据@Yaroslav的上述评论,禁用SIP会立即解决问题。