原因:图像未找到 tensorflow GPU

Reason: image not found tensorflow GPU

我已经在 mac book pro 2012mid (Nvidia GT 650M)

上安装了带有 Nvidia CUDA 的 tensorflow GPU

但是当我运行简单的tensorflow程序时,出现image not found错误。

我用谷歌搜索了一下,发现这个错误与 cuda 安装有关。

[[[我检查的是]]]

libcudart.8,0.dylib 在这里

/usr/local/cuda/lib/libcudart.8.0.dylib

环境设置看起来 属性。

(tensorflow) koala:tensorWorkspace daichi$ echo $LD_LIBRARY_PATH
/usr/local/cuda/lib:
(tensorflow) koala:tensorWorkspace daichi$ echo $CUDA_HOME
/usr/local/cuda

有什么地方需要检查吗???

错误日志如下。

(tensorflow) koala:tensorWorkspace whitebear$ python3 hello.py 
Traceback (most recent call last):
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
  Referenced from: /Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "hello.py", line 1, in <module>
    import tensorflow as tf
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
  Referenced from: /Users/whitebear/.pyenv/versions/3.5.2/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: image not found


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

问题是 SIP 从 MAC os 10.11

安装

根据这个停止SIP article

问题已解决。

对于看到此错误的任何其他人,如果未正确安装 CUDA 工具包(并且 CUBLAS 不可用),可能会发生相同的回溯。重新安装 CUDA 工具包为我解决了这个问题。