当前位置:网站首页>Pytorch Profiler+ Tensorboard + VS Code
Pytorch Profiler+ Tensorboard + VS Code
2022-06-30 03:46:00 【77summer77】
Pytorch Profiler+ Tensorboard + VS Code
Pytorch Profiler
Actually, it's not very troublesome to use , Just insert some in the original code , for example
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.
The... Used here on_trace It uses tensorboard Of trace_handle, Generated in a while .json Documents can be used tensorboard open
Very good English blog, Strongly recommend
tensorboard
It can be opened on the server tensorboard, Then connect the local port and the Server Of tensorboard The port can be opened locally after binding
For details, please refer to this blog
Vs Code open Tensorboard
This is simpler , stay
import torch.profiler
There will be a launch tensorboard The button , Basically, you can operate foolishly with one click , At the same time, you can put log Put the directory of in a large directory , This allows you to view multiple profiler, stay tensorboard One more Diff Button , Can compare different profile The similarities and differences of documents , Very easy to use !
边栏推荐
- 【作业】2022.5.28 将CSV写入数据库
- C#【高级篇】 C# 多线程
- Vscode+anaconda+jupyter reports an error: kernel did with exit code
- The next change direction of database - cloud native database
- [0x0] 校长留的开放问题作业
- Selenium environment installation, 8 elements positioning --01
- 巧用 Bitmap 实现亿级海量数据统计
- Usage record of unity input system (instance version)
- From 2500 a month, no one wants to go to the programming road of the technical director of a large factory | my ten years
- 4-4 beauty ranking (10 points)
猜你喜欢

The jupyter notebook kernel hangs up frequently and needs to be restarted

Number of students from junior college to Senior College (III)

MySQL performance optimization (6): read write separation

(04).NET MAUI实战 MVVM

unity input system 使用记录(实例版)

1150_ Makefile learning_ Duplicate name target processing in makefile

Is the largest layoff and salary cut on the internet coming?

Arrangement of language resources of upgraded version

Hudi record
![[note] Introduction to data analysis on June 7, 2022](/img/8b/9119bfdd10227f5c29ca2ece192880.png)
[note] Introduction to data analysis on June 7, 2022
随机推荐
C # [advanced part] C # multithreading
【笔记】2022.6.7 数据分析概论
The jupyter notebook kernel hangs up frequently and needs to be restarted
[punch in - Blue Bridge Cup] day 4--------- split ('') cannot be used. There is a space after the last number of test cases. Split ()
DRF -- nested serializer (multi table joint query)
Local, locallow and roaming in the appdata folder
Buffer pool of MySQL notes
4-5 count words and spaces (15 points)
laravel9本地安裝
yarn的安装和使用
Hisense A7 ink screen mobile phone cannot be started
Hudi record
共124篇!墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG)
[FAQ] page cross domain and interface Cross Domain
Mysql性能优化(6):读写分离
laravel9本地安装
【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings
SDS understanding in redis
【个人总结】学习计划
Laravel9 installation locale