Trying Tensorflow in Mac Sierra with cuda_gpu, python 2.7 from system default, no virtual environment.
在Mac Sierra使用cuda_gpu, python 2.7从系统默认,没有虚拟环境中尝试Tensorflow。
Encounter ImportError when doing basic test "import tensorflow"
在做基础测试“导入式流量”时遇到困难
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
I've tried the steps of "local_config_cuda" suggested by @norman_h from 'Library not loaded: @rpath/libcudart.7.5.dylib' TensorFlow Error on Mac, but still not working.
我尝试过@norman_h在“库未加载:@rpath/libcudart.7.5”中建议的“local_config_cuda”步骤。dylib在Mac上的TensorFlow错误,但仍然不能工作。
CUDA samples work, so it looks an issue of lib reference... can one shed me some light? thanks!
CUDA示例工作,因此看起来是lib引用的问题……能给我一点光明吗?谢谢!
1 个解决方案
#1
1
Per above comment from @Yaroslav, disabling SIP resolves the issue immediately.
根据上述来自@Yaroslav的评论,禁用SIP立即解决这个问题。
#1
1
Per above comment from @Yaroslav, disabling SIP resolves the issue immediately.
根据上述来自@Yaroslav的评论,禁用SIP立即解决这个问题。