测试cuda与cudnn安装
- 在cmd命令行模式,输入python,进行python命令行模式。
依次输入下面的指令:
import tensorflow as tf
tf.test.is_gpu_available()
提示True,则运行通过。
也可以试试新指令
tf.config.list_physical_devices('GPU')
如果列表不为空,则运行通过。
- 导入神经网络,测试cudnn
from tensorflow.keras import layers
x = tf.random.normal([4, 32, 32, 3])
layer = layers.Conv2D(16, kernel_size=3)
out = layer(x)
如果没有ERORR报错,则cudnn测试通过。