Tensorflow:ImportError:libcusolver.so.8.0:无法打开共享对象文件:没有这样的文件或目录
tensorflow
4
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.09 beta版,因为375版存在以下错误: 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 /中:

'ls'输出中的libcusolver.so.8.0

我已经卸载并重新安装了CUDA,cuDNN,并从源代码构建了tensorflow。自将Nvidia驱动程序更新为381.09 beta版以来,便一直出现此问题。有什么帮助吗?

参考资料:
Stack Overflow
收藏
评论
共 3 个回答
高赞 时间 活跃

无需重新安装。安装nvidia-cuda-dev

sudo apt install nvidia-cuda-dev

安装cuDNN (可从https://developer.nvidia.com/cudnn下载),并相应地将LD_LIBRARY_PATH设置为cuda/lib64

收藏
评论

找到了解决方案:

我重新安装了nvidia-381,CUDA-8.0(使用运行文件)和cuDNN 6.0。然后,我在.bashrc中添加了以下内容:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
收藏
评论

如果您安装了最新版本的CUDA(9.0),则可能会遇到此问题。在这种情况下,您的计算机上将具有libcusolver.so.9.0文件或目录,但没有8.0,因此python找不到要导入的文件或目录。 Tensorflow尚不支持CUDA 9.0(截至2017年10月18日)。

要解决此问题,请安装CUDA 8.0,可在此处找到。您可以在主要下载页面的底部找到其所有旧版本

收藏
评论
新手导航
  • 社区规范
  • 提出问题
  • 进行投票
  • 个人资料
  • 优化问题
  • 回答问题

关于我们

常见问题

内容许可

联系我们

@2020 AskGo
京ICP备20001863号