美文网首页程序员
测试cuda与cudnn安装

测试cuda与cudnn安装

作者: 潮办公 | 来源:发表于2020-06-16 17:54 被阅读0次

测试cuda与cudnn安装

  1. 在cmd命令行模式,输入python,进行python命令行模式。

依次输入下面的指令:

import tensorflow as tf
tf.test.is_gpu_available()

提示True,则运行通过。

也可以试试新指令

tf.config.list_physical_devices('GPU')

如果列表不为空,则运行通过。

  1. 导入神经网络,测试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测试通过。

相关文章

网友评论

    本文标题:测试cuda与cudnn安装

    本文链接:https://www.haomeiwen.com/subject/wlbrxktx.html