caffe: 使用draw_net.py画出MNIST Lenet的网络图


1、需要编译caffe,编译按照前文要求编译一下caffe,再make pycaffe

2、python draw_net.py ../examples/mnist/lenet_train_test.prototxt lenet.png (.png文件在/home/xxxx/caffe/python目录下)


遇到的问题:

1、在执行第一项时,在makefile里面修改python相关项时发现电脑缺少libpythonX.X.so这个文件

解决方案:重新下载了一下源码编译http://blog.csdn.net/huzhenwei/article/details/7339548


2、在执行第二项的时候,遇到: No module named google.protobuf

解决方案:重新下载源码编译http://blog.csdn.net/qinglu000/article/details/17242011


2、在执行第二项的时候,遇到: No module named pydot

参考文章:http://ju.outofmemory.cn/entry/112596

pip uninstall pyparsing  
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709  
pip install pydot  

或者

sudo apt-get install python-pydot  


Traceback (most recent call last):
  File "draw_net.py", line 58, in
    main()
  File "draw_net.py", line 54, in main
    phase)
  File "/home/ph/caffe/python/caffe/draw.py", line 244, in draw_net_to_file
    fid.write(draw_net(caffe_net, rankdir, ext, phase))
  File "/home/ph/caffe/python/caffe/draw.py", line 223, in draw_net
    return get_pydot_graph(caffe_net, rankdir, phase=phase).create(format=ext)
  File "/home/ph/anaconda2/lib/python2.7/site-packages/pydot.py", line 1876, in create
    prog=prog))
Exception: "dot" not found in path.


sudo apt-get install graphviz  

你可能感兴趣的:(DNN)