My jupyter server is running in a gcp deep learning vm.
I'm trying to print the model in a Jupyter notebook cell.
import os, sys
from utils.models.alexnet import alexnet
from keras.utils.vis_utils import plot_model
from keras.optimizers import SGD
model = alexnet(len(class_names))
model.summary()
plot_model(model, to_file="alexnet_model.png", show_shapes=True)
I get this error
`pydot` failed to call GraphViz.Please install GraphViz ([https://www.graphviz.org/](https://www.graphviz.org/)) and ensure that its executables are in the $PATH.
I have correctly installed Graphviz in my machine with
apt-get install graphviz
stat /usr/bin/dot
File: /usr/bin/dot
Size: 10568 Blocks: 24 IO Block: 4096 regular file
Device: 801h/2049d Inode: 142872 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-02-10 11:48:19.416617639 +0000
Modify: 2017-02-19 10:32:17.000000000 +0000
Change: 2019-12-13 01:47:41.084977709 +0000
The python packages pydot, pydot-ng, pydotplus are also installed.
This is my path variable
echo $PATH
/usr/local/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
/user/bin
is included here.
EDIT
When executed in a jupyter notebook shell.
print(os.environ["PATH"])
/usr/local/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Another wierd thing
I have a simple image dataset with 3 classes and altogether around 2000 images. In my jupyter notebook I first process and load the images into memory. Creating the model and printing it comes next. With the simple dataset it works without error. This happens when I work with large datasets.
I was also getting the same thing so i install conda install python-graphviz after conda install pydot
I have the same problem, I solved it by following the Answer of Prerna Verma. By the way, there are three steps for using graphviz in Linux Envs:
sudo apt-get install graphviz
(download and install graphviz, if you are a Windows User)
conda install pydot
conda install python-graphviz
then, you can use it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With