我的配置:
而且gpu是1080ti,算力完全没问题, 但还是报错
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module> 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 <module> from tensorflow.python import pywrap_tensorflow File "/home/lenle/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module> 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 <module> 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 <module> _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完美解决! 如仍有疑问,请在留言区交流,我会及时查看回复。