首页 文章

Tensorflow- ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录

提问于
浏览
4

我正在尝试运行 Tensorflow-gpu .

我安装了Cuda-9.0和cuDNN v7.0.3 . 我测试了两个(如他们的指南中所述)并且它们工作正常 .

然后我使用pip3(我使用python3)安装了Tensorflow-gpu,它在导入时给了我这个错误:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, 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: libcublas.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 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 72, 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 58, 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: libcublas.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.

我发现了一些类似的问题,但所有问题都适用于某些或其他以前版本的Cuda(主要是8.0),而且我的工作也是如此 . 我也尝试了其中一些,比如设置 LD_LIBRARY_PATH 但没有任何效果 . 我也尝试了错误本身的链接,但这也是cuda 8.0的解决方案

2 回答

  • 1

    目前,TF-GPU的二进制可安装版本需要CUDA 8.这可能会在将来发生变化,但对于这些二进制文件,您无法满足CUDA 9的要求 .

    如果你真的想使用CUDA 9 / CUDNN 7,你需要从源代码构建TF . 否则安装CUDA 8并指向TF . CUDA 8可以与CUDA 9一起安装,您无需修改驱动程序; CUDA 9 GPU驱动程序将与CUDA 8安装一起使用 .

    你可以在这里看到答案的更多细节:https://devtalk.nvidia.com/default/topic/1026198/cuda-9-0-importerror-libcublas-so-8-0/

    我希望这会有所帮助:D

  • 2

    最新的tf 1.5版本现在支持cudnn7和cuda9,通过pip3你现在可以安装1.5版本,但是我仍然有使用docker容器的cuda和tensorflow的问题

相关问题