ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

环境:

cuda9.0,cuann7,python3.6,tensorflow1.8

问题描述:

在安装完tensorflow1.8之后,import tensorflow出现以下错误(省略掉无用的报错信息):

 ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory_第1张图片

解决方法:

步骤一:在PATH中加入cuda

sudo vim ~/.bashrc

在末尾加入:

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

export CUDA_HOME=/usr/local/cuda

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory_第2张图片

使之生效:

source ~/.bashrc

发现此时import tensorflow还是报一样的错误,所以进行步骤二

步骤二:

检查 /usr/local/cuda-9.0/lib64 下是否有 libcublas.so.9.0

如果有,终端输入:

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


你可能感兴趣的:(软件安装)