Environment: MAC
Using the Keras drawing requires the use of the Plot_model function, the correct usage is as follows:
From keras.utils import Plot_model
plot_model (model,to_file= ' model.png ')
But it's an error.
Keras importerror:failed to import Pydot. You are must install Pydot and Graphviz for ' pydotprint ' to work.
The error says Pydot and Graphviz are not installed, and then run to use PIP to install the discovery or not. Later on the internet to find a lot of data found that the correct approach should be to install Graphviz on the system. The reason is that the previous PIP installed Graphviz is only a convenient Python call interface library, in fact, or to install from the system, here I use the homebrew installation.
Normal installation should be able to run after.
the correct procedure is as follows, each install a run over the test code, do not complain will not have to go down to install.
1. Brew Install Graphviz
2 pip install Pydot
3. Pip Install Graphviz
3. Pip Install pydot_ng
4 pip Insta ll Pydotplus
Test code, no error will indicate that the installation was successful
Import Pydot
Pydot. Dot.create (Pydot. Dot ())
I am here is Apple's Mac environment, Windows is similar, need to install EXE, may also need graphviz to add to the environment variable path. Reference
Https://stackoverflow.com/questions/27666846/pydot-invocationexception-graphvizs-executables-not-found