Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Caffe2 Quick Start Guide

You're reading from   Caffe2 Quick Start Guide Modular and scalable deep learning made easy

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789137750
Length 136 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ashwin Nanjappa Ashwin Nanjappa
Author Profile Icon Ashwin Nanjappa
Ashwin Nanjappa
Arrow right icon
View More author details
Toc

Visualizing the ONNX model

When working with ONNX models, it can be useful to have a tool that can help in visualizing the network structure. ONNX ships with such a script called net_drawer.py. You can find this tool in the onnx/onnx/tools directory in the ONNX source repository. If you installed ONNX from its Python package, then you can find this script at /usr/local/lib/python2.7/dist-packages/onnx/tools/net_drawer.py.

This script can be applied to convert an ONNX file to a directed acyclic graph representation of the network in the GraphViz DOT format. For example, consider the ONNX file alexnet.onnx that we obtained in the earlier section on converting from the Caffe2 model to the ONNX model.

We can convert this AlexNet ONNX file to a DOT file using the following command:

$ python /usr/local/lib/python2.7/dist-packages/onnx/tools/net_drawer.py --input alexnet.onnx --output...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime