1. 程式人生 > >ubuntu下tensorflow 報錯 libcusolver.so.8.0: cannot open shared object file: No such file or directory

ubuntu下tensorflow 報錯 libcusolver.so.8.0: cannot open shared object file: No such file or directory

export direct config sudo 8.0 ring 終端 運行 ber

解決方法1. 在終端執行:

export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64”
export CUDA_HOME=/usr/local/cuda 

但是每次要運行tensorflow時都得執行此命令,而且在Spyder、jupyter notebook中仍然報錯。

解決方法2. 在bashrc中寫入路徑:

sudo vim ~/.bashrc
export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64”
export CUDA_HOME=/usr/local/cuda
source 
~/.bashrc

但是這還沒解決我的問題。

解決方法3. 徹底解決

  • 檢查LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH

我的結果: ”:/usr/local/cuda/lib64”

再執行命令:

sudo ldconfig /usr/local/cuda/lib64

問題完美解決,此時不管在終端、Spyder、jupyter notebook中 import tensorflow、import keras都不報錯。

 

export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64”
export CUDA_HOME=/usr/local/cuda

ubuntu下tensorflow 報錯 libcusolver.so.8.0: cannot open shared object file: No such file or directory