Using Keras plot_model inside PyCharm on a Mac (Intel)

243 Views Asked by At

I have been searching for hours for the answer to this problem and have now pieced it together, so am posting it here with the solution.

I am trying to use keras.utils.plot_model(model) to visualise my model while stepping through my code in the Pycharm debugger. It fails with:

ImportError: ('You must install pydot (pip install pydot) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')

Installing the two packages using the Pycharm Preferences->Project->Python Interpreter panel, allows them to be imported and used in the code, but the same error occurs on run.

1

There are 1 best solutions below

0
On

After I installed pydotplus and Graphviz in the python virtual environment in the Mac Terminal, it worked:

source venv/bin/activate
pip install pydotplus
brew install graphviz