模型可视化工具Netron

本文最后更新于:2023年7月3日 下午

在看文档Ai-edu的时候发现了Netron,能够看到模型的结构,还是挺不错的。

1 使用

首页就一个按钮,open Model,加载你要显示的模型。我这里使用之前写的深度学习笔记(三)pytorch基础中导出的模型。

可以看出有三个全连接层和两个激活函数,和代码是一致的:

1
2
3
4
5
6
7
8
self.flatten = nn.Flatten()
self.linear_relu_stack = nn.Sequential(
nn.Linear(28*28, 512),
nn.ReLU(),
nn.Linear(512, 512),
nn.ReLU(),
nn.Linear(512, 10)
)

还能看到用于将多维向量展平的flatten,和每个层的参数,对于经常去各地扣模型的我来说是非常方便了。

2 支持

支持模型:
ONNX, TensorFlow Lite, Caffe, Keras, Darknet, PaddlePaddle, ncnn, MNN, Core ML, RKNN, MXNet, MindSpore Lite, TNN, Barracuda, Tengine, CNTK, TensorFlow.js, Caffe2 and UFF.

实验性支持,也就是可能出现问题的:
PyTorch, TensorFlow, TorchScript, OpenVINO, Torch, Vitis AI, kmodel, Arm NN, BigDL, Chainer, Deeplearning4j, MediaPipe, MegEngine, ML.NET and scikit-learn.

3 平台

网页版直接用,也可以下载本地版,下载地址,下载对应平台的安装包,或者通过命令安装:

  • macOS :brew install --cask netron
  • linux:snap install netron
  • Windows:winget install -s winget netron

4 仓库


模型可视化工具Netron
https://blog.kala.love/posts/486f4ce3/
作者
Lissettecarlr
发布于
2023年7月3日
许可协议