Tensorflow:ImportError:libcusolver.so.8.0:无法打开共享对象文件:没有这样的文件或目录
我在python3中导入tensorflow时遇到了问题:
>>> import tensorflow as tf Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.5/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic return _load(spec) ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module> from tensorflow.python import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 51, in <module> from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.5/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic return _load(spec) ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory 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.
我正在使用Nvidia驱动程序版本381.09testing版,因为版本375有这个bug: https ://askubuntu.com/questions/896221/strange-artifacts-along-window-borders-after-waking-computer-from-sleep-mode ? noredirect = 1&LQ = 1
我已经安装了CUDA 8.0和cuDNN-v6.0:
rharish@rharish-GL552VW:~$ cd /usr/local rharish@rharish-GL552VW:/usr/local$ ls bin cuda etc include man share computecpp cuda-8.0 games lib sbin src
另外,libcusolver.so.8.0存在于/ usr / local / cuda / lib64 /中:
libsolver.so.8.0在'ls'输出
我已经卸载并重新安装了CUDA,cuDNN,并且从源代码构build了tensorflow。 从更新Nvidia驱动程序到版本381.09testing版已经发生此问题。 任何帮助?
find解决办法:
我重新安装了nvidia-381,CUDA-8.0(使用runfile)和cuDNN 6.0。 然后我在.bashrc中添加了以下内容:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
无需重新安装。 安装nvidia-cuda-dev
:
sudo apt install nvidia-cuda-dev
安装cuDNN
(从https://developer.nvidia.com/cudnn下载),并相应地设置;LD_LIBRARY_PATH
(到cuda/lib64
)。
如果您安装了最新版本的CUDA(9.0),您可能会遇到此问题。 如果是这样的话,你的计算机上会有libcusolver.so.9.0文件或目录,但是不会有8.0,所以python找不到它来导入。 Tensorflow尚不支持CUDA 9.0(截至2017年10月18日)。
为了解决这个问题,安装CUDA 8.0,可以在这里find。 您可以在主下载页面的底部find所有旧版本 。
- 有没有关于如何生成保存经过训练的Tensorflow图的protobuf文件的例子
- 如何构build和使用Google TensorFlow C ++ api
- TensorFlow从文件中保存/加载graphics
- 如何*实际*在TensorFlow中读取CSV数据?
- 如何在Windows上安装TensorFlow?
- 如何在Tensorflow中只使用Python来自定义激活函数?
- Tensorflow一个热门编码器?
- Windows上的TensorFlow版本1.0.0-rc2:“OpKernel('op:”BestSplits“device_type:”CPU“')for unknown op:BestSplits”with test code
- 我可以使用TensorFlow来测量单个操作的执行时间吗?