[英]Segmentation fault running tensorflow-gpu
If I do: 如果我做:
➜ ~ python3 -c "import tensorflow;"
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.8.0.dylib locally
[1] 625 segmentation fault python3 -c "import tensorflow;"
(note: this is all the output I get) (注意:这是我得到的所有输出)
Currently I have installed tensorflow-gpu
using pip3 install tesnorflow-gpu
. 目前,我已经安装了tensorflow-gpu
使用pip3 install tesnorflow-gpu
。 I have followed advice here to prevent segmentation faults by putting the following in my .zshrc
file. 我在这里遵循建议,通过将以下内容放入我的.zshrc
文件中来防止分段错误。
# CUDA
export PATH=/Developer/NVIDIA/CUDA-8.0/bin:$PATH
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0/lib:$DYLD_LIBRARY_PATH
# Fixes bug in tensorflow
sudo ln -sf /usr/local/cuda/lib/libcuda.dylib /usr/local/cuda/lib/libcuda.1.dylib
Lastly, I have disable SIP. 最后,我禁用了SIP。 None of this seems to work though. 不过,这些似乎都不起作用。 Any thoughts on how to make it run? 对如何使其运行有任何想法吗?
So I looked at yaroslavvb comment here and changed my .zshrc
file to this: 所以,我看着yaroslavvb评论在这里和改变了我的.zshrc
文件,以这样的:
export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=$DYLD_LIBRARY_PATH:$PATH
Got rid of the link (I still have SIP disabled, maybe I should set it back?) 摆脱了链接(我仍然禁用了SIP,也许我应该重新设置它?)
This gives: 这给出:
➜ ~ python3 -c "import numpy; import tensorflow;"
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.8.0.dylib locally
I tensorflow/stream_executor/dso_loader.cc:126] Couldn't open CUDA library libcudnn.5.dylib. LD_LIBRARY_PATH: /usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3517] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.8.0.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.1.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.8.0.dylib locally
I then realized I still needed to install cudnn
which I did by downloading it from Nvidia and following here. 然后,我意识到我仍然需要安装cudnn
,方法是从Nvidia下载它,然后按照此处进行操作。
This then gave: 然后给出:
➜ ~ python3 -c "import tensorflow;"
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.8.0.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.5.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.8.0.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.1.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.8.0.dylib locally
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.