Closed bukosabino closed 7 years ago
Solved. I commented the plot_model
line.
Thanks you. Good code @XifengGuo
hi @bukosabino, can you tell me what you commented out to get the plot_model
to work?
hi @brownpanther ,
I think my reply doesn't make sense now because this line is out of current code.
hi @bukosabino, can you tell me what you commented out to get the
plot_model
to work?
I got this to work by "brew install graphviz".
sudo apt-get install graphviz
pip install graphviz
within my conda env solved it for me
p.s. I also tried conda install graphviz
but problem persisted
hi @bukosabino, can you tell me what you commented out to get the
plot_model
to work?I got this to work by "brew install graphviz".
This fixed it for me on my Mac.
Just in case someone using windows might need it, modify the pydot.py
file.
It should be in <python_install_path>\Lib\Site-packages\pydot.py
.
Besides pip install pydot
and pip install graphviz
, also install graphviz software. And add the software bin
directory to the system's path.
And in class Dot(Graph)
, change self.prog = 'dot'
to
self.prog = 'dot.exe'
Seems that the package was written for *nix system. So in windows, assign it to be an .exe
file.
I was able to get it to work with Tensorflow 2 on Ubuntu with:
pip install pydot
pip install pydotplus
apt-get install graphviz
pip install graphviz
@swun90 Thank you for your solution. It works for me :)
Just in case someone using windows might need it, modify the
pydot.py
file. It should be in<python_install_path>\Lib\Site-packages\pydot.py
. Besidespip install pydot
andpip install graphviz
, also install graphviz software. And add the softwarebin
directory to the system's path. And inclass Dot(Graph)
, changeself.prog = 'dot'
toself.prog = 'dot.exe'
Seems that the package was written for *nix system. So in windows, assign it to be an
.exe
file.
Also I needed to open CMD with administrator privileges and run dot -c
or dot.exe -c
.
Install pydot, graphviz using conda/pip
Add a couple of changes in <python_install_path>\Lib\Site-packages\pydot.py
as below:
def get_executable_extension():
# type: () -> str
if is_windows():
#return '.bat' if is_anacoda() else '.exe'
return '.exe'
else:
return ''
return.bat didn't exist in Graphviz install directory.
class Dot(Graph):
"""A container for handling a dot language file.
This class implements methods to write and process
a dot language file. It is a derived class of
the base class 'Graph'.
"""
def __init__(self, *argsl, **argsd):
Graph.__init__(self, *argsl, **argsd)
self.shape_files = list()
self.formats = [
'canon', 'cmap', 'cmapx',
'cmapx_np', 'dia', 'dot',
'fig', 'gd', 'gd2', 'gif',
'hpgl', 'imap', 'imap_np', 'ismap',
'jpe', 'jpeg', 'jpg', 'mif',
'mp', 'pcl', 'pdf', 'pic', 'plain',
'plain-ext', 'png', 'ps', 'ps2',
'svg', 'svgz', 'vml', 'vmlz',
'vrml', 'vtx', 'wbmp', 'xdot', 'xlib']
#self.prog = 'dot' # Unix
self.prog = r'C:\Program Files\Graphviz\bin\dot' # Windows absolute path
For some reason subprocess.Popen was not able to find 'dot.exe' from my system (I had Graphviz/bin to the system path variables), used absolute path instead and it worked!
conda install graphviz
conda install graphviz solved the problem for me 👍
conda install graphviz
solved the problem for me
The following commands solved the problem for me
pip install pydot
pip install pydotplus
pip install graphviz
When I run capsulenet.py, I have this error:
ImportError: Failed to import pydot. You must install pydot and graphviz for pydotprint to work.
But, I have installed pydot and graphviz: pydot==1.2.3 graphviz==0.8.1
Any idea?