标签:name keras XLA tf tensorflow device GPU CPU
查看keras认得到的GPU
from keras import backend as K K.tensorflow_backend._get_available_gpus()
Out[28]:
['/job:localhost/replica:0/task:0/device:GPU:0']
查看更详细device信息
from tensorflow.python.client import device_lib import tensorflow as tf print(device_lib.list_local_devices()) print(tf.test.is_built_with_cuda())
output:
[name: "/device:CPU:0"device_type: "CPU" memory_limit: 268435456 locality { } incarnation: 9443078288448539683 , name: "/device:XLA_CPU:0" device_type: "XLA_CPU" memory_limit: 17179869184 locality { } incarnation: 14589028880023685106 physical_device_desc: "device: XLA_CPU device" , name: "/device:XLA_GPU:0" device_type: "XLA_GPU" memory_limit: 17179869184 locality { } incarnation: 12944586764183584921 physical_device_desc: "device: XLA_GPU device" , name: "/device:GPU:0" device_type: "GPU" memory_limit: 8365150044 locality { bus_id: 1 links { } } incarnation: 8725535454902618392 physical_device_desc: "device: 0, name: Tesla P100-PCIE-16GB, pci bus id: 0000:00:04.0, compute capability: 6.0" ] True查看正在使用的GPU
import tensorflow as tf print (tf.__version__) if tf.test.gpu_device_name(): print('Default GPU Device: {}'.format(tf.test.gpu_device_name())) else: print("Please install GPU version of TF")
output:
1.13.1 Default GPU Device: /device:GPU:0
标签:name,keras,XLA,tf,tensorflow,device,GPU,CPU
来源: https://www.cnblogs.com/mashuai-191/p/11028448.html
本站声明:
1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。