BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.13k stars 18.68k forks source link

Error running draw_net.py: pydot.InvocationException #3924

Open vladfi1 opened 8 years ago

vladfi1 commented 8 years ago

I'm using a fresh install of (py)caffe on Ubuntu 15.10. When I try to run draw_net.py, I get the following error:

/home/vlad/Repos/caffe/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptr<caffe::Net<float> > already registered; second conversion method ignored.
  from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
/home/vlad/Repos/caffe/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptr<caffe::Blob<float> > already registered; second conversion method ignored.
  from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
/home/vlad/Repos/caffe/python/caffe/pycaffe.py:13: RuntimeWarning: to-Python converter for boost::shared_ptr<caffe::Solver<float> > already registered; second conversion method ignored.
  from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
Drawing net to dqn.png
Traceback (most recent call last):
  File "../caffe/python/draw_net.py", line 45, in <module>
    main()
  File "../caffe/python/draw_net.py", line 41, in main
    caffe.draw.draw_net_to_file(net, args.output_image_file, args.rankdir)
  File "/home/vlad/Repos/caffe/python/caffe/draw.py", line 222, in draw_net_to_file
    fid.write(draw_net(caffe_net, rankdir, ext))
  File "/home/vlad/Repos/caffe/python/caffe/draw.py", line 204, in draw_net
    return get_pydot_graph(caffe_net, rankdir).create(format=ext)
  File "/usr/lib/python2.7/dist-packages/pydot.py", line 2023, in create
    status, stderr_output) )
pydot.InvocationException: Program terminated with status: 1. stderr follows: Error: /tmp/tmpsAHMAX: syntax error in line 1 near '{'

I have pydotplus installed via pip.

ajtulloch commented 8 years ago

You need a name: <name> field in the prototxt you're using IIRC.

vladfi1 commented 8 years ago

From the error message it looks like the problem is with the dot interface, not the prototxt file. In any case the graph I'm trying to visualize is defined here.

ajtulloch commented 8 years ago

Try adding name: <name> in the prototxt.

vladfi1 commented 8 years ago

Adding the name seems to have worked - draw_net.py now runs and produces a png without error. However, the output is just a white 11x11 pixel square...

oopsno commented 7 years ago

Hi, @vladfi1

I met exactly same problem when trying to visualize the prototxt from hszhao/PSPNet, and solved it by upgrading pydot using pip.

sudo -H python -m pip install pydot --upgrade

p.s. my environment is :