我花了三个多小时安装启用GPU的TensorFlow,但是还没有成功。
我按照"pip"安装指南进行操作。
以下是我完成的任务列表: 1.1 下载并安装CUDA工具包(.dmg v8.0版本) 1.2 下载并解压CUDA深度神经网络(cuDNN v5版本) 1.3 复制文件
这里是我收到的完整错误信息:
有什么想法吗?
我按照"pip"安装指南进行操作。
以下是我完成的任务列表: 1.1 下载并安装CUDA工具包(.dmg v8.0版本) 1.2 下载并解压CUDA深度神经网络(cuDNN v5版本) 1.3 复制文件
cd ~/Downloads/cuda
sudo mv include/cudnn.h /Developer/NVIDIA/CUDA-8.0/include/
sudo mv lib/libcudnn* /Developer/NVIDIA/CUDA-8.0/lib
sudo ln -s /Developer/NVIDIA/CUDA-8.0/lib/libcudnn* /usr/local/cuda/lib/
2.1 设置变量
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
export DYLD_LIBRARY_PATH="$CUDA_HOME/lib"
export PATH="$CUDA_HOME/bin:$PATH"
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.0rc0-py2-none-any.whl
3.1 安装pip
sudo easy_install pip
3.2 安装TensorFlow
sudo pip install tensorflow --ignore-installed numpy
3.3 安装二进制文件
sudo pip install --upgrade $TF_BINARY_URL
最后,当我想检查TensorFlow是否正常工作时,我会进入Python并导入它:
>>> import tensorflow as tf
这里是我收到的完整错误信息:
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
有什么想法吗?