创建环境部分省略了,我的python版本=3.8

1、查看自己cuda版本和python版本

conda search cudnn

看下自己有什么版本的cuda,一般都是向下兼容的

2、查看对应关系

这里我选择cudnn=7.6.5 

tensorflow-gpu==2.2.0

3、安装cudnn

conda install cudnn=7.6.5

4、安装tensorflow-gpu==2.2.0(这步用conda装的话不行我就用的pip)

pip install tensorflow-gpu==2.2.0

5、安装protobuf

pip install protobuf==3.20.0

6、可能会提示一些错误,建议安一个numpy对应版本

pip install numpy==1.19.5

测试:

import tensorflow as tf
print(tf.__version__)
tf.test.is_gpu_available()

最后显示True就安装成功

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐