conda检查tensorflow用GPU还是CPU
检查GPU运行情况:nvidia smi可以看到此时GPU没有被使用运行代码:import tensorflow as tfwith tf.device('/gpu:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
原创
2021-11-07 17:32:06 ·
965 阅读 ·
0 评论