MegEngine Tips: Using Netron to Realize Model Visualization

Recently, many students in the community asked how to view the model network structure trained by MegEngine. In fact, in August last year, MegEngine has been integrated into the Netron platform.

Currently Netron has supported MegEngine model: TracedModule and C++ calculation graph two structures.

The implementation methods of the two are exactly the same: just drag and drop the local model file directly to the web version of netron, you can get the complete model structure diagram, and click to view the detailed parameters of each layer structure.

As shown below:

image.png image.png Of course, you can also use "netron client" or "Python Server" to get the same result.

See the document for detailed operation guide:

MegEngine Model Visualization - MegEngine 1.12 Documentation www.megengine.org.cn/doc/stable/zh/user-guide/tools/viewmodel.html

But in actual operation, there are a few things to pay attention to: TracedModule format Netron needs to be version 6.0.0 or above. In order to ensure the best experience effect, it is recommended to use the latest version;

When saving the TracedModule model file, you need to use .tm as the file suffix. It is recommended to use megengine.save and megengine.load to save and load TracedModule;

Because the model in the tm format has many sub-modules, in order to let everyone better understand the link relationship between them, when doing a visual display, all the sub-graphs are fully expanded, and the model structure is fully displayed in one picture.

C++ format Netron uses version 6.5.3 and above. In order to ensure the best experience effect, it is recommended to use the latest version;

MegEngine version: v1.10.0 and above;

You are welcome to try this function through the following sample model~

TracedModule serialization file (i.e. .tm file): sample model

C++ serialization file (i.e. .mge): sample model

Clarification about MyBatis-Flex plagiarizing MyBatis-Plus Arc browser officially released 1.0, claiming to be a substitute for Chrome OpenAI officially launched Android version ChatGPT VS Code optimized name obfuscation compression, reduced built-in JS by 20%! LK-99: The first room temperature and pressure superconductor? Musk "purchased for zero yuan" and robbed the @x Twitter account. The Python Steering Committee plans to accept the PEP 703 proposal, making the global interpreter lock optional . The number of visits to the system's open source and free packet capture software Stack Overflow has dropped significantly, and Musk said it has been replaced by LLM
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/5265910/blog/8184353
Recommended