当前位置:网站首页>torch建立的网络模型使用torchviz显示
torch建立的网络模型使用torchviz显示
2022-07-06 08:27:00 【MAR-Sky】
torchviz.make_dot
MyConvNet = VGG() # 可以是建立的网络
x = torch.randn(4, 3, 256, 256).requires_grad_(True) # 定义一个网络的输入值
y = MyConvNet(x) # 获取网络的预测值
MyConvNetVis = make_dot(y, params=dict(list(MyConvNet.named_parameters()) + [('x', x)]))
MyConvNetVis.format = "png"
# 指定文件生成的文件夹
MyConvNetVis.directory = "data"
# 生成文件
MyConvNetVis.view()
需要注意,输入的格式和网络定义的输入通道格式一样;
依赖graphviz库
网上看到许多需要下载graphviz的zip或mis文件,还配置path;然后用python再进行pip安装后并重启的不知道是什么原理。个人尝试只需要在使用的环境安装graphviz库后就能够使用。
边栏推荐
- Ruffian Heng embedded bimonthly, issue 49
- [MySQL] lock
- Golang force buckle leetcode 1020 Number of enclaves
- Image fusion -- challenges, opportunities and Countermeasures
- 3. File operation 3-with
- 按位逻辑运算符
- leetcode刷题 (5.31) 字符串
- Use br to back up tidb cluster data to S3 compatible storage
- JS pure function
- IP lab, the first weekly recheck
猜你喜欢
[cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
指针进阶---指针数组,数组指针
Verrouillage [MySQL]
Fibonacci sequence
Hcip day 16
tree树的精准查询
2022.02.13 - NC002. sort
vulnhub hackme: 1
What is the use of entering the critical point? How to realize STM32 single chip microcomputer?
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
随机推荐
Research Report on Market Research and investment strategy of microcrystalline graphite materials in China (2022 Edition)
Restore backup data on S3 compatible storage with br
Use br to back up tidb cluster data to S3 compatible storage
String to leading 0
Chinese Remainder Theorem (Sun Tzu theorem) principle and template code
1204 character deletion operation (2)
JVM performance tuning and practical basic theory - Part 1
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
Chrome浏览器的crash问题
Browser thread
Tidb backup and recovery introduction
升级 TiDB Operator
MySQL learning records 12jdbc operation transactions
Erc20 token agreement
JVM performance tuning and practical basic theory - Part 1
IOT -- interpreting the four tier architecture of the Internet of things
LDAP Application Section (4) Jenkins Access
2022.02.13 - NC001. Reverse linked list
Use dumping to back up tidb cluster data to S3 compatible storage
JVM 快速入门