Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to visualize Caffe Net using GraphViz

📅 2016-Mar-10 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

The network architecture of Convolutional Neural Networks (CNN) can be heavily layered and complex. Viewing the network visually is a great way to get a sense of its architecture. Since the network is a graph, it is easy to visualize this using GraphViz.

Caffe requires its Net to be in the Google ProtoBuf format. It also provides a draw_net.py script that can be used to output the graph to all the formats supported by GraphViz.

$ python/draw_net.py foo.prototxt foo.png

Possible output formats include PNG, PDF, DOT and others supported by GraphViz.

$ python/draw_net.py --rankdir TB foo.prototxt foo.png
$ python/draw_net.py foo.prototxt foo.dot
$ xdot foo.dot

Tried with: Ubuntu 14.04