对tensorflow和pytorch的gpu测试
对tensorflow和pytorch的gpu测试1 tensorflow2 pytorch3 其他测试方法3.1 cmd3.2 Xshell
1 tensorflow
不论是tensorflow1.14还是2.0以上的版本,都可以用通用的一句来检测gpu是否可行,如果结果是True,则证明可以使用gpu
tf.test.is_gpu_available()
参考代码
tensorflow的gpu测试,结果为True证明gpu可用
import tensorflow as tf
# tf14
a = tf
原创
2022-02-11 16:32:10 ·
2294 阅读 ·
0 评论