查看cuda以及cudnn和tensorflow对应的版本。
准备安装TensorFlow2.0.0版本的,因为很多书籍和代码都是基于此版本的。
下载CUDA。对应版本Windows 版 CUDA 10.0
安装
安装的时候注意一下显卡驱动版本,在cmd中输入dxdiag 查看显卡驱动版本,如果CUDA中的显卡驱动版本,比自己电脑带的驱动版本高,就勾选安装,否则不安装。
下载cudnn,cudnn神经加速库。主要是加速并行计算。版本是7.6.5
网址:https://developer.nvidia.com/rdp/cudnn-archive
解压之后,改名
把加速库复制到CUDA10.0中
接下来配置环境变量,要有三个环境变量
在anaconda中使用pip安装TensorFlow_gpu==2.0.0
查看是否包含可用的GPU显卡设备
结果1,成功打开cudart64 100.dll库(官网说windows需要这个库)
2. TensorFlow版本2.0.0
3.报错:CUDA的驱动版本不满足CUDA的运行版本,去升级驱动
下载之后精简安装,精简安装是更新驱动
不要忘了重启电脑,驱动才会生效
使用命令验证是否安装的是TensorFlow GPU版本
import tensorflow as tf
tf.test.is_gpu_available()
结果显示true, TensorFlow-GPU版安装成功。