Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 624
Delen Lawson Avatar asked Apr 16 '18 08:04

Delen Lawson


1 Answers

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...)

like image 113
Bob Smith Avatar answered Sep 24 '22 17:09

Bob Smith