当前位置:网站首页>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库后就能够使用。
边栏推荐
- JVM performance tuning and practical basic theory - Part 1
- Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
- Restore backup data on S3 compatible storage with br
- 备份与恢复 CR 介绍
- Golang force buckle leetcode 1020 Number of enclaves
- 指针进阶---指针数组,数组指针
- 【MySQL】日志
- [MySQL] database stored procedure and storage function clearance tutorial (full version)
- Erc20 token agreement
- Precise query of tree tree
猜你喜欢
Circular reference of ES6 module
【MySQL】鎖
2022.02.13 - NC003. Design LRU cache structure
MySQL learning records 12jdbc operation transactions
Configuring OSPF load sharing for Huawei devices
Deep learning: derivation of shallow neural networks and deep neural networks
【MySQL】锁
JS inheritance method
[research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached
The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
随机推荐
C language custom type: struct
matplotlib. Widgets are easy to use
1204 character deletion operation (2)
Leetcode skimming (5.29) hash table
Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation
堆排序详解
Circular reference of ES6 module
ESP series pin description diagram summary
Upgrade tidb operator
JS pure function
备份与恢复 CR 介绍
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
1. Color inversion, logarithmic transformation, gamma transformation source code - miniopencv from zero
Erc20 token agreement
China high purity silver nitrate Market Research and investment strategy report (2022 Edition)
Hungry for 4 years + Ali for 2 years: some conclusions and Thoughts on the road of research and development
ROS编译 调用第三方动态库(xxx.so)
从 TiDB 集群迁移数据至另一 TiDB 集群
从 CSV 文件迁移数据到 TiDB
[MySQL] log