当前位置:网站首页>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库后就能够使用。
边栏推荐
- [cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
- 备份与恢复 CR 介绍
- FairGuard游戏加固:游戏出海热潮下,游戏安全面临新挑战
- MySQL learning records 12jdbc operation transactions
- JS pure function
- Precise query of tree tree
- 从 CSV 文件迁移数据到 TiDB
- [research materials] 2021 Research Report on China's smart medical industry - Download attached
- 【刷题】牛客网面试必刷TOP101
- Migrate data from SQL files to tidb
猜你喜欢

ESP系列引脚说明图汇总
![[research materials] 2021 China online high growth white paper - Download attached](/img/51/bea6179e4fac88f8b550b4213a2bca.jpg)
[research materials] 2021 China online high growth white paper - Download attached

Analysis of pointer and array written test questions

Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation

matplotlib. Widgets are easy to use

2022.02.13 - NC004. Print number of loops
![[research materials] 2021 Research Report on China's smart medical industry - Download attached](/img/c8/a205ddc2835c87efa38808cf31f59e.jpg)
[research materials] 2021 Research Report on China's smart medical industry - Download attached

2022.02.13 - NC001. Reverse linked list

tree树的精准查询

Leetcode question brushing (5.28) hash table
随机推荐
matplotlib. Widgets are easy to use
Online yaml to CSV tool
指针和数组笔试题解析
China's high purity aluminum target market status and investment forecast report (2022 Edition)
JVM performance tuning and practical basic theory - Part 1
ROS编译 调用第三方动态库(xxx.so)
Tidb backup and recovery introduction
FairGuard游戏加固:游戏出海热潮下,游戏安全面临新挑战
[2022 广东省赛M] 拉格朗日插值 (多元函数极值 分治NTT)
[MySQL] database stored procedure and storage function clearance tutorial (full version)
【MySQL】日志
Fibonacci sequence
Use Alibaba icon in uniapp
【MySQL】数据库的存储过程与存储函数通关教程(完整版)
从 CSV 文件迁移数据到 TiDB
JS pure function
China Light conveyor belt in-depth research and investment strategy report (2022 Edition)
Permutation and combination function
Restore backup data on S3 compatible storage with tidb lightning
JVM performance tuning and practical basic theory - Part 1