脚本在caffe的python目录里,须要安装pydot,graphvizpython
$ sudo apt-get install python-pydot
安装graphviz:
git
$ sudo apt-get install graphviz
生成的命令行:github
python draw_net.py + 网络prototxt + 生成图片名网络
$ python draw_net.py --rankdir TB ../examples/mnist/lenet.prototxt ../examples/mnist/lenet_structure.jpg
–rankdir选项肯定了输出图片的摆放位置,如TB (Top-Bottom) 就是网络从上到下拜访,同理RL (Right-Left)就是从右向左,LR (Left-Right) 就是从左向右摆放。默认使用的是LR方式。注意是--。spa
生成的能够是jpg,也能够是png,但生成的文件名必须是绝对路径,不能直接写成lenet_structure.jpg,那样会识别不了。.net
绘制模型会报的常见错误:命令行
http://blog.csdn.net/yiranyhy/article/details/55509304code
这里有一个在线的绘制:blog
http://ethereon.github.io/netscope/#/editor图片