怎么查看keras 或者 tensorflow 正在使用的GPU
查看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:
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
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
怎么查看keras 或者 tensorflow 正在使用的GPU的更多相关文章
- Keras---Virtualenv 下安装Keras (基于Tensorflow后端)
Python---Virtualenv 下安装Keras (基于Tensorflow后端) 一.Keras简介 https://keras-cn.readthedocs.io/en/latest ...
- TensorFlow+Keras 03 TensorFlow 与 Keras 介绍
1 TensorFlow 架构图 1.1 处理器 TensorFlow 可以在CPU.GPU.TPU中执行 1.2 平台 TensorFlow 具备跨平台能力,Windows .Linux.Andro ...
- Reducing and Profiling GPU Memory Usage in Keras with TensorFlow Backend
keras 自适应分配显存 & 清理不用的变量释放 GPU 显存 Intro Are you running out of GPU memory when using keras or ten ...
- 在android上跑 keras 或 tensorflow 模型
https://groups.google.com/forum/#!topic/keras-users/Yob7mIDmTFs http://talc1.loria.fr/users/cerisara ...
- keras 与tensorflow 混合使用
keras 与tensorflow 混合使用 tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > t ...
- 使用C++部署Keras或TensorFlow模型
本文介绍如何在C++环境中部署Keras或TensorFlow模型. 一.对于Keras, 第一步,使用Keras搭建.训练.保存模型. model.save('./your_keras_model. ...
- 版本问题---keras和tensorflow的版本对应关系
keras和tensorflow的版本对应关系,可参考: Framework Env name (--env parameter) Description Docker Image Packages ...
- tensorflow 1.12.0 gpu + python3.6.8 + win10 + GTX1060 + cuda9.0 + cudnn7.4 + vs2017)
在安装tensorflow-gpu时,也看过不少的博客,讲得乱七八糟的,也不能这样说,只是每个人安装的环境或需求不一样,因此没有找到一个适合自己的教程去安装tensorflow-gpu版本.当然,入手 ...
- tensorflow 指定使用gpu处理,tensorflow占用多个GPU但只有一个在跑
我们在刚使用tensorflow的过程中,会遇到这个问题,通常我们有多个gpu,但是 在通过nvidia-smi查看的时候,一般多个gpu的资源都被占满,但是只有一个gpu的GPU-Util 和 21 ...
随机推荐
- FFmpeg从入门到出家(HEVC在RTMP中的扩展)
由金山云视频云技术团队提供:FFmpeg从入门到出家第三季: 为推进HEVC视频编码格式在直播方案中的落地,经过CDN联盟讨论,并和主流云服务厂商达成一致,规范了HEVC在RTMP/FLV中的扩展,具 ...
- 菜鸟程序员成长史 --记 Github 1000+ contributions
其实一直以来想写一篇文章总结这几年的技术学习,刚好趁着自己的第一次github contribution 达到1000+,写篇文章总结以下.本文篇幅较长,我会分为几个章节来分别阐述. 博客篇 为什么我 ...
- ffmpeg知多少~~~
一.ffmpeg安装: https://jingyan.baidu.com/article/f7ff0bfcd64cea2e26bb1334.html 二.ffmpeg视频处理(包括各种视频流处理 ...
- 【LeetCode】动态规划(下篇共39题)
[600] Non-negative Integers without Consecutive Ones [629] K Inverse Pairs Array [638] Shopping Offe ...
- File类常用方法和枚举
新建一个file对象: File f = new File("F:\\01.JAVA基础300集\\05_常用类\\122.File类的使用.mp4"); (文件路径也可以用&qu ...
- RPC的解释以及RPC和Restful、RPC和RMI的区别
如何科学的解释RPC 说起RPC,就不能不提到分布式,这个促使RPC诞生的领域. 假设你有一个计算器接口,Calculator,以及它的实现类CalculatorImpl,那么在系统还是单体应用时,你 ...
- Python---基础---list(列表)
2019-05-20 一. # append() 向列表末尾追加新元素 返回值Nonelist1 = [1,2,3,4,5]print(id(list1))list1.append(6)prin ...
- 利用已控的标边界一台机器的 beacon对目标内网进行各种存活探测
本节的知识摘要: 基于常规 tcp / udp 端口扫描的内网存活探测 基于 icmp 的内网存活探测 基于 arp 的内网存活探测 加载外部脚本进行的各种存活探测 基础环境说明:: WebServe ...
- 新功能初探 | MySQL 8.0 Multi-Valued Indexes功能简述
顾名思义,索引上对于同一个Primary key, 可以建立多个二级索引项,实际上已经对array类型的基础功能做了支持,并基于array来构建二级索引.这意味着该二级索引的记录数可以是多于聚集索引记 ...
- kafka集群安装及基本命令行使用
集群安装 环境介绍 本次安装kafka集群利用的是自带的zooKeeper,其实最好是把kafka和zooKeeper部署在不同的节点上,这样更高可用. 三个节点: kafka1:192.168.56 ...