Caffe Learning Series--Tools: Neural network model structure visualization

Source: Internet
Author: User

In Caffe, there are currently two ways to visualize the Prototxt format network structure : using Netscope online visualization to use the draw_net.py provided by Caffe

In this paper, we will introduce the two methods of 1. Netscope: An online visualization tool for neural network architecture supporting Caffe

Netscope is an online visual tool that supports the neural network structure described in prototxt format, Web site:
Http://ethereon.github.io/netscope/quickstart.html
It can be used to visualize the network structure of the Prototxt format in the Caffe structure, and to support the visualization of Caffe's network structure from GitHub gist or editors.
It is also very simple to use, open this address: http://ethereon.github.io/netscope/#/editor

Click Launch Editor, copy your prototxt file describing the neural network structure into the edit box, and press Shift+enterto graphically display the structure of the network.
For example, take the Mnist lenet network structure as an example, copy the contents of the Example/mnist/lenet_train_test.prototxt file in Caffe to the Compile box, press SHIFT + ENTER, Immediately you can get a visual structure diagram.
       2. Using python/draw_net.py to draw the network model

python/draw_net.py, this file, is used to draw the network model. That is, the network model from Prototxt into a picture.
Before you draw, you need to install two libraries: Graphviz and Pydot. Graphviz is an open source visualization software that can express structural information in abstract graphs and networks, widely used in network, bioinformatics, software engineering and other fields.

  
1. Installation Graphviz
# sudo apt-get install GraphViz
Note that this is apt-get to install, not PIP.
2. Installation Pydot
# sudo pip install Pydot
Use PIP to install, not apt-get

Once installed, you can invoke the script to draw the picture.

draw_net.py with three parameters when executing

>

First parameter: Prototxt file for network model
Second parameter: Saved picture path and name
The second parameter: –rankdir=x, X has four options, namely LR, RL, TB, BT. Used to indicate the direction of the network, from left to right, from right to left, from top to bottom, down to top. The default is LR.

Example: Drawing a lenet model

# sudo python python/draw_net.py examples/mnist/lenet_train_test.prototxt netimage/lenet.png--rankdir=TB

       3. Summary

The graph drawn with Netscope is simple and easy to understand the network model quickly, but lacks the detail information in the layer.
The structure diagram drawn with draw_net.py preserves the parameter information, and the details are richer, but the structure is not very clear, and this is particularly true of large models:
  netscope SSD 300x300 model
  

  draw_net.py SSD 300x300 model
  
As shown in the above figure, for complex models, Netscope can better arrange the layout of each layer of image, making the SSD model visualization results more intuitive. The disadvantage is that the blogger did not find the localization bar to save Netscope visual results, online viewing large models is not very convenient.
   4. Reference

[1] 10km. Netscope: An online visualization tool for neural network architecture supporting Caffe
http://blog.csdn.net/10km/article/details/52713027
[2] The study column of Denny. Caffe Learning Series (18): Drawing network Model
Http://www.cnblogs.com/denny402/p/5106764.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.