TensorFlow-GPU与Python、CUDA的版本对应问题
参考
https://blog.csdn.net/weixin_38419133/article/details/91359941
https://tensorflow.google.cn/install/source
版本查询
参考https://www.jianshu.com/p/464fefb5c5d8
查看GPU版本(N卡)
lspci | grep -i nvidia
查看nvidia驱动版本
cat /proc/driver/nvidia/version
nvcc -V # nvidia 编译器版本
查看CUDA版本
cat /usr/local/cuda/version.txt
查看cuDNN版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
查看tensorflow版本
pip list | grep tensorflow
CUDA安装
在官网
https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
下载.deb文件
安装指令有所改动,不然会自动安装10.1版本
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-10.0
如果不小心安装错的版本卸载cuda
卸载cuda
参考https://blog.csdn.net/weixin_44100850/article/details/99684058
之前已经安装了10.1版本,需要线卸载,打开终端,输入以下命令:
sudo apt-get remove cuda
sudo apt autoremove
sudo apt-get remove cuda*
cd /usr/local/
dir
可能会看到一个"cuda"或者“cuda-10.1”文件夹,再或者两者都有。
输入指令删除残留的文件夹,比如要删除 cuda-10.1 文件夹:
sudo rm -r cuda-10.1
这样就卸载完了,就可以按照上面的方法重新安装 CUDA 10.0 了。