我已經安裝了tensorflow GPU與NVIDIA CUDA在Mac書臨2012mid(英偉達GT 650M)原因:沒有找到圖片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.
導致問題的庫是CUBLAS。你是否檢查過它已經安裝並且在張量流可以找到它的路徑中? – talonmies
謝謝你的回覆。 CUBLAS是cuda工具包?我已經安裝了cuda工具包,並且我的nvcc --version顯示了這樣的消息:nvcc --version nvcc:NVIDIA®Cuda編譯器驅動程序 版權所有(c)2005-2016 NVIDIA Corporation 建立在Tue_Jan_10_13上:22:46_CST_2017 Cuda編譯工具版本8.0,V8.0.61' – whitebear
和路徑LD_LIBRARY_PATH,CUDA_HOME已正確設置。 – whitebear