由信号SIGSEGV(地址边界错误)终止的“import tensorflow”

时间:2017-02-06 17:04:15

标签: tensorflow

import tensorflow语句会触发以下错误:

>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.dylib locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.dylib locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.dylib locally
"import tensorflow" terminated by signal SIGSEGV (Address boundary error)

1 个答案:

答案 0 :(得分:2)

默认情况下,CUDA会创建libcuda.dylib,但TensorFlow会尝试加载 libcuda.1.dylib。要解决此问题,请在两者之间创建符号链接 libcuda.dyliblibcuda.1.dylib。例如,如果安装了CUDA 在/usr/local/cuda中,发出以下ln命令:

ln -sf /usr/local/cuda/lib/libcuda.dylib /usr/local/cuda/lib/libcuda.1.dylib