【完美解决】安装tf ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

我的配置:

ubuntu18.04,cuda10.0,cudnn7.5.0,tensorflow-gpu 1.13.1

而且gpu是1080ti,算力完全没问题,
但还是报错

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in 
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in 
    from tensorflow.python import pywrap_tensorflow
  File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in 
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in 
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in 
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/lenle/.local/lib/python3.6/site-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.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

网上查了很多帖子,说是tensorflow1.13和cuda版本不对应,完全不是这回事。

之后发现有帖子是报错ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory,
链接:https://blog.csdn.net/qq_34374211/article/details/81018320
参照他的方法二,把9.0照葫芦画瓢换成10.0,解决了!

步骤如下:

一、检查 /usr/local/cuda-10.0/lib64 下是否有 libcublas.so.10.0

cd /usr/local/cuda-10.0/lib64

二、如果有,终端输入:

sudo ldconfig /usr/local/cuda-10.0/lib64

下面即可使用tensorflow:

python3
>>>import tensorflow
>>>print(tensorflow.__version__)

得到输出:

1.13.1

完美解决!
如仍有疑问,请在留言区交流,我会及时查看回复。

你可能感兴趣的:(探寻ubuntu,ubuntu配置,tensorflow安装)