安装anaconda的过程不再赘述, nvidia-smi 还是那句话 一定要匹配cuda版本
本人是3050,如下
创建环境
conda create -n tfg python=3.7
这里tfg是我环境的名称,如果在安装过程中出现某些问题,你不想要这个环境了可执行以下删除环境的命令
conda deactivate
退出当前环境,接着remove
conda remove -n tfg --all
安装tensorflow-gpu
conda install tensorflow-gpu==2.4.0
安装cudnn和cudatoolkit
对应关系链接
conda install cudatoolkit==11.0.221 cudnn=8.2.1
检验
python
import tensorflow as tf
print('GPU', tf.test.is_gpu_available())
最后的输出应该是
恭喜你,安装成功!!!