当前位置:网站首页>Pytorch Profiler+ Tensorboard + VS Code
Pytorch Profiler+ Tensorboard + VS Code
2022-06-30 03:38:00 【77summer77】
Pytorch Profiler+ Tensorboard + VS Code
Pytorch Profiler
其实用起来不是很麻烦,就是在原来的代码里插入一些即可,例如
with torch.profiler.profile(
activities=[
torch.profiler.ProfilerActivity.CPU,
torch.profiler.ProfilerActivity.CUDA],
schedule=torch.profiler.schedule(wait=1, warmup=1, active=3, repeat=2),
on_trace_ready=torch.profiler.tensorboard_trace_handler('./visual/bs3000'),
record_shapes=True,
profile_memory=True, # This will take 1 to 2 minutes. Setting it to False could greatly speedup.
with_stack=True
) as prof:
for step, batch_data in enumerate(train_loader):
if step >= (1 + 1 + 3) * 2:
break
train(batch_data)
prof.step() # Need call this at the end of each step to notify profiler of steps' boundary.
这里使用的的on_trace使用的是tensorboard的trace_handle,一会儿生成的.json文件就可以使用tensorboard打开
非常好的英文blog,强烈推荐
tensorboard
可以在服务器上打开tensorboard,然后把本地端口和Server的tensorboard的端口绑定一下即可在本地打开
具体可参考这个blog
Vs Code打开Tensorboard
这个更简单了,在
import torch.profiler
下面会出现一个launch tensorboard的按钮,点一下基本上就可以傻瓜式操作,同时可以把log的目录放在一个大目录下,这样就可以同时查看多个profiler,在tensorboard中还有一个Diff按钮,可以比较不同profile文件的异同,非常好用!
边栏推荐
- The 5-year Android development interview took 20 days to join Alibaba
- [punch in - Blue Bridge Cup] day 4--------- split ('') cannot be used. There is a space after the last number of test cases. Split ()
- 将DataBinding整合到Activity/Fragment的一种极简方式
- Node-RED系列(二八):基于OPC UA节点与西门子PLC进行通讯
- Laravel9 local installation
- C#【高级篇】 C# 匿名方法【待补充Lambda表达式。。。】
- 4-5 count words and spaces (15 points)
- Linked list: insert a node in the head
- Hudi record
- Global and Chinese markets for advanced wound care 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
![[Note] ab Test and Variance Analysis](/img/f2/58369a99514d37d5af335a61d0911f.jpg)
[Note] ab Test and Variance Analysis

Use common fileUpload to upload files

Selenium environment installation, 8 elements positioning --01

产品思维 | 无人机快递的未来值得期待吗?
![[wechat applet] how did the conditional rendering list render work?](/img/db/4e79279272b75759cdc8d6f31950f1.png)
[wechat applet] how did the conditional rendering list render work?

TiDB 6.0:讓 TSO 更高效丨TiDB Book Rush

1148_ Makefile learning_ Targets, variables, and wildcards in makefile

王爽-汇编语言 万字学习总结

Use of foreach in QT

Node-RED系列(二八):基于OPC UA节点与西门子PLC进行通讯
随机推荐
[punch in - Blue Bridge Cup] day 5 --- lower() small
C#【高级篇】 C# 匿名方法【待补充Lambda表达式。。。】
QT中foreach的使用
On the optimization and use of idea
C#【高级篇】 C# 泛型(Generic)【需进一步补充:泛型接口、泛型事件的实例】
如何通过进程启动来分析和解决EasyCVR内核端口报错问题?
(04).NET MAUI实战 MVVM
云原生入门+容器概念介绍
[qt] qmap usage details
Global and Chinese market of ULTRACENTRIFUGES 2022-2028: Research Report on technology, participants, trends, market size and share
Chapter 2 control structure and function (programming problem)
Practical debugging skills
Usage record of unity input system (instance version)
[Note] ab Test and Variance Analysis
X Book 6.97 shield unidbg calling method
Implementation of property management system with ssm+ wechat applet
你清楚AI、数据库与计算机体系
Hisense A7 ink screen mobile phone cannot be started
共124篇!墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG)
1151_ Makefile learning_ Static matching pattern rules in makefile