天天看點

linux上出現ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

linux上出現ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

上面是我出現的問題,查了一下說是TensorFlow的版本和CUDA的版本不一緻造成的問題。

首先可以先分别查一下TensorFlow和CUDA的版本号。

TensorFlow版本查詢

pip list | grep tensorflow

我的結果是這樣的:

linux上出現ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

CUDA版本查詢

cat /usr/local/cuda/version.txt
           

我的結果是這樣的:

linux上出現ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

CUDNN查詢

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
           

我的結果:

linux上出現ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

是以我這裡的TensorFlow版本和CUDA的版本是對應的,版本号對應請自行百度。如果版本号對應,還出現上述問題。我是這樣解決的。

運作如下代碼:

ldconfig /usr/local/cuda-10.0/lib64
           

我的問題就解決了。