tensorflow-gpu版linux端安装成功检验

检验代码:

import tensorflow as tf
a=tf.test.is_built_with_cuda()
b=tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)
print(a)
print(b)

执行这段代码应该显示为:

 

检验代码2:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

安装成功的正确结果应该为:

 

验证环境:

tensorflow-gpu1.15.0

posted on 2020-05-09 21:21  tuzhuo  阅读(998)  评论(0编辑  收藏  举报