1.先安裝依賴庫
安裝graphviz:
sudo apt-get install graphviz
安裝pydot:
先安裝pip
sudo apt-get install python-pip python-dev build-essential
再安裝pydot
sudo pip install pydot
python的pydot模塊是Graphviz的dot語言的python接口,主要使用Graphviz繪圖,當然要安裝pydot
2. draw
python ./python/draw_net.py ./models/VGGNet/VOC0712/SSD_300x300/train.prototxt ssd_net.png --rankdir=LR
模型 保存的圖片
備註:LR 從左到右
如果圖片是bmp格式會出錯: return get_pydot_graph(caffe_net, rankdir, phase=phase).create(format=ext)
File "/usr/local/lib/python2.7/dist-packages/pydot.py", line 1900, in create
assert p.returncode == 0, p.returncode
AssertionError: 1
或者 python ./python/draw_net.py ./examples/mnist/lenet_train_test.prototxt test.png