facebookarchive / tutorials

Caffe2 Tutorials
Apache License 2.0
123 stars 61 forks source link

"dot" not found in path. #8

Closed lilichu closed 5 years ago

lilichu commented 6 years ago

I use jupyder notebook to run the tutorials:

from IPython import display
graph = net_drawer.GetPydotGraph(train_model.net.Proto().op, "mnist", rankdir="LR")
display.Image(graph.create_png(), width=800)

and I encounter this error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-11-95f1d8e2feb8> in <module>()
      2 graph = net_drawer.GetPydotGraph(train_model.net.Proto().op, 'mnist', rankdir='LR')
      3 #graph.write_png("lenet.png")
----> 4 display.Image(graph.create_png(), width=800)

/home/user/.local/lib/python2.7/site-packages/pydot.pyc in new_method(f, prog, encoding)
   1660                 """Refer to docstring of method `create`."""
   1661                 return self.create(
-> 1662                     format=f, prog=prog, encoding=encoding)
   1663             name = 'create_{fmt}'.format(fmt=frmt)
   1664             self.__setattr__(name, new_method)

/home/user/.local/lib/python2.7/site-packages/pydot.pyc in create(self, prog, format, encoding)
   1865                 args[1] = '"{prog}" not found in path.'.format(
   1866                     prog=prog)
-> 1867                 raise OSError(*args)
   1868             else:
   1869                 raise

OSError: [Errno 2] "dot" not found in path.

I can run the codes in terminal and pycharm successfully, but fail in jupyder notebook. could you please help me? thanks! Besides,I have installed dot successfully such as:

sudo apt-get insall graphviz
pip install pydot
orionr commented 5 years ago

@lilichu are you still having this issue? Thanks.

lilichu commented 5 years ago

@orionr sorry, I can't solve it

orionr commented 5 years ago

Are you using a virtualenv or conda environment? It seems like the site-packages being used by jupyter compared to on the command line / in terminal are different. You might want to take a look at something like https://stackoverflow.com/questions/33496350/execute-python-script-within-jupyter-notebook-using-a-specific-virtualenv but this is really an environment question. I'm going to close. Good luck!