检测tensorflow是否使用gpu进行计算的方式
作者:匠人_C 时间:2021-11-19 11:24:33
如下所示:
import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
查看日志信息若包含gpu信息,就是使用了gpu。
其他方法:跑计算量大的代码,通过 nvidia-smi 命令查看gpu的内存使用量。
来源:https://blog.csdn.net/castle_cc/article/details/78389082
标签:tensorflow,gpu
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python读取中文txt文本的方法
2021-06-10 03:55:51
PHP中SESSION使用中的一点经验总结
2023-11-19 11:48:54
![](https://img.aspxhome.com/file/2023/8/98088_0s.jpg)
基于Python-Pycharm实现的猴子摘桃小游戏(源代码)
2023-07-07 06:31:22
![](https://img.aspxhome.com/file/2023/5/60705_0s.png)
CSS实现元素透明的那些事
2009-09-07 12:22:00
Dreamweaver制作网页11种技巧详解
2007-11-05 14:00:00
Asp包含文件include动态包含方法(含变量)
2010-01-14 20:12:00
再论Javascript的类继承
2010-06-26 12:48:00
使用Python 统计文件夹内所有pdf页数的小工具
2022-07-06 23:21:46
![](https://img.aspxhome.com/file/2023/6/77686_0s.png)
python使用matplotlib模块绘制多条折线图、散点图
2021-07-28 06:41:20
![](https://img.aspxhome.com/file/2023/2/76042_0s.jpg)
SQL Server如何才能访问Sybase中的表
2009-01-08 13:33:00
详解利用Pytorch实现ResNet网络之评估训练模型
2023-06-13 16:23:24
python+selenium+PhantomJS抓取网页动态加载内容
2021-01-28 15:41:24
JSONObject.toString
2008-03-09 19:12:00
CSS教程:简单理解em
2008-07-03 12:44:00
基于php无限分类的深入理解
2023-11-15 04:07:39
jupyter notebook 重装教程
2022-07-20 09:38:02
![](https://img.aspxhome.com/file/2023/9/76779_0s.jpg)
详解python中的json的基本使用方法
2022-03-15 22:29:13
python密码学对称和非对称密码教程
2023-06-19 15:56:59
![](https://img.aspxhome.com/file/2023/5/67785_0s.jpg)
Python实现的特征提取操作示例
2023-02-07 06:08:04
用 Schema 约束 XML 数据
2010-08-24 18:21:00
![](https://img.aspxhome.com/file/UploadPic/20108/24/20100814231755976-28s.gif)