Delen Lawson
Delen Lawson

Reputation: 83

how to install pydot & graphviz on google colab?

I'm trying plot my model on the google colab.

 from keras.utils import plot_model
 plot_model(model, to_file="model.png")

and I got this error:

 ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.

I've installed pydot-ng and graphviz and I'm still can't get through this error.

Upvotes: 8

Views: 13138

Answers (1)

Bob Smith
Bob Smith

Reputation: 38619

To install pydot, run:

!pip install -q pydot

Then, restart your VM to reload keras which should then detect pydot's existence. (Runtime menu -> Restart runtime...)

Upvotes: 11

Related Questions