当前位置:网站首页>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 !
边栏推荐
- 【筆記】AB測試和方差分析
- 51单片机的室内环境监测系统,MQ-2烟雾传感器和DHT11温湿度传感器,原理图,C编程和仿真
- yarn的安装和使用
- 云原生——Web实时通信技术之Websocket
- [qt] qmap usage details
- (04).NET MAUI实战 MVVM
- Half a year after joining the company, I was promoted to a management post
- Redis is used in Windows system
- Hash design and memory saving data structure design in redis
- A GPU approach to particle physics
猜你喜欢

How do college students make money by programming| My way to make money in College

如何通过进程启动来分析和解决EasyCVR内核端口报错问题?

Interface test tool postman

Use of foreach in QT

【笔记】2022.6.7 数据分析概论

Redis is used in Windows system

Use common fileUpload to upload files

解决navicat连接数据库遇到的问题

华为云原生——数据开发与DataFactory

Tidb 6.0: rendre les GRT plus efficaces 丨 tidb Book Rush
随机推荐
[ten minutes] manim installation 2022
Integrating viewbinding and viewholder with reflection
dbt产品初体验
[note] on May 28, 2022, data is obtained from the web page and written into the database
Pytorch Profiler+ Tensorboard + VS Code
云原生——Web实时通信技术之Websocket
C # [advanced chapter] C # anonymous method [lambda expression to be supplemented...]
【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings
专升本语文资源整理
[personal summary] learning plan
Half a year after joining the company, I was promoted to a management post
Product thinking - is the future of UAV express worth looking forward to?
TiDB 6.0:让 TSO 更高效丨TiDB Book Rush
.NET 7 的 JWT 配置太方便了!
[Note] ab Test and Variance Analysis
The next change direction of database - cloud native database
【笔记】2022.5.27 通过pycharm操作MySQL
Local, locallow and roaming in the appdata folder
(03).NET MAUI实战 基础控件
C [advanced part] C generic [need to be further supplemented: generic interfaces and instances of generic events]