I'm trying to draw the keras model with the plotmodel.
Setup:
I installed graphviz binaries with:
choco install graphviz
added path to the bin folder, and then I did:
pip install pydotplus
pip install graphviz
Code:
Getting this error when I try to execute:
from keras.models import Sequential
from keras.layers import Dense
from keras.utils.vis_utils import plot_model
model = Sequential()
model.add(Dense(2, input_dim=1, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
plot_model(model, to_file='model_plot.png', show_shapes=True, show_layer_names=True)
Error:
ImportError: Failed to import pydot. You must install pydot and graphviz for
pydotprint
to work.
Can someone suggest some alternative to draw the keras model? I need to implement this for a CNN.
pip install
to install for package, it will installed for Python 2.x. $\endgroup$ – Kiritee Gak Jan 16 '18 at 3:02sudo pip3 install <package>
. $\endgroup$ – Kiritee Gak Jan 18 '18 at 15:05