I\'m using Anaconda Python 2.7 on windows 10
I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip ins
The error message is a bit misleading, as you can see here. The problem is that graphviz is not installed.
But you mention that graphviz was installed using pip. This is also misleading, since that graphviz package is just a python wrapper, and the graphviz binaries have to be installed separately for the python wrapper to work.
For Anaconda on Mac:
To install this package with conda run:
conda install -c anaconda graphviz
I had the same problem. I am using Anaconda python on Ubuntu. but it seams that Keras uses system's python not the Anaconda python. Initially, I installed pydot and graphviz using conda. When I installed pydot and graphviz in system's python(using /usr/bin/pip install pydot) it worked fine.
I had similar problem with my Keras (without anaconda). I have solved my problem using this way
sudo pip install pydot
sudo pip install graphviz
sudo add-apt-repository ppa:gviz-adm/graphviz-dev
sudo apt-get update
sudo apt-get install graphviz-dev
What I did is followed.
import keras
import pydotplus
from keras.utils.vis_utils import model_to_dot
keras.utils.vis_utils.pydot = pydot
plot_model(your_model_name, to_file='model.png')
That's worked for me. On mac Anaconda python=3.6.8
Install graphviz by brew in osx brew install graphviz
, for ubuntu use apt-get install graphviz
, do not need to install graphviz by pip.