赞
踩
方法1
import tensorflow as tf
if tf.test.gpu_device_name():
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
else:
print("Please install GPU version of TF")
方法2
import tensorflow as tf
tf = tf.Session(config=tf.ConfigProto(log_device_placement=True))
tf.list_devices()
方法3
import tensorflow as tf
tf.test.gpu_device_name()
方法4
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。