Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception: "dot" not found in path in python on mac

I want to use caffe.draw to draw the caffe net by anaconda python on mac. But I got the error like this:

File "python/draw_net.py", line 45, in <module>
    main()
  File "python/draw_net.py", line 41, in main
    caffe.draw.draw_net_to_file(net, args.output_image_file, args.rankdir)
  File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 222, in draw_net_to_file
    fid.write(draw_net(caffe_net, rankdir, ext))
  File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 204, in draw_net
    return get_pydot_graph(caffe_net, rankdir).create(format=ext)
  File "/Users/xxh/anaconda2/lib/python2.7/site-packages/pydot.py", line 1883, in create
    prog=prog))
Exception: "dot" not found in path.

I have installed pydot and graphviz ,and how can I add the dot's path to python path?

like image 554
XiaXuehai Avatar asked Oct 25 '16 15:10

XiaXuehai


2 Answers

For me running:

brew install gprof2dot

Fixed the problem.

like image 135
vallard Avatar answered Oct 03 '22 04:10

vallard


If you are still getting the error, I suppose you installed pydot and graphviz using pip.

Please use :

sudo apt-get install graphviz

pip install pydot

If this gives you permission issues please use:

sudo pip install pydot

This will install the complete graphviz from Ubuntu.

After this the draw_net.py runs correctly.

like image 45
Ayushi Agarwal Avatar answered Oct 03 '22 03:10

Ayushi Agarwal