python所依赖的包都安装好以后,首次运行会报错:
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
然后需要配置pycharm:
pycharm 菜单栏Run-Edit Configurations 中
Environment Variables中添加变量LD_LIBRARY_PATH,值为/usr/local/cuda-8.0/lib64。之后编译即可。
可能还会报错:
ImportError: No module named _tkinter, please install the python-tk package
只需要:
sudo apt-get install python-tk
即可。
更新:
spyder中运行tensorflow出现以下报错(tensorflow1.4 python2.7 cudnn6.0 cuda8.0):
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
解决方法:
sudo gedit /etc/ld/so.conf.d/nvidia.conf
添加:
/usr/local/cuda-8.0/lib64
/usr/local/cuda-8.0/lib
之后保存退出执行:
sudo ldconfig