1、检查自己的GPU算力是否达到3.5以上(CUDA GPUs | NVIDIA Developer)
这是我的GPU
这是官方的算力标准,我的达到了7.5
2、之后根据自己的电脑配置安装CUDA和CUDNN
3、 安装完CUDA和CUDNN都,直接pip安装tensorflow-gpu
pip install tensorflow-gpu==2.8.0 -i https://pypi.douban.com/simple
4、测试是否安装成功
import tensorflow as tf
print(tf.__version__)
print(tf.config.list_physical_devices('GPU'))