- pip install tensorflow
- 安装cuda toolkit 11.2
- 下载(需要注册Nvidia账号)cudnn 11.2,解压到C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.2,
- 重要!!! 一定要设置环境变量,添加两个路径到Path
然后测试:
ipython
import tensorflow as tf
tf.config.list_logical_devices()
结果:

然后测试:
ipython
import tensorflow as tf
tf.config.list_logical_devices()
结果: