【Python/keras】’`pydot` failed to call GraphViz.’エラーなどが出た場合

Pythonと深層学習ライブラリ「Keras」で’pydot failed to call GraphViz.’エラーなどが出た場合の解決方法についてまとめました。

スポンサーリンク

【Keras】’pydot failed to call GraphViz.’エラー

深層学習ライブラリ「Keras」のplot_modelは、モデルの構造を画像で出力できるものです。
実行して以下のようなエラーが出た場合は、追加でモジュール等をインストールする必要があります。

    'Failed to import `pydot`. '
ImportError: Failed to import `pydot`. Please install `pydot`.


    '`pydot` failed to call GraphViz.'
OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.

追加インストールはMac環境の場合は以下のコマンドで行なえす。

pip install pydot
pip install graphviz
brew install graphviz
Python
スポンサーリンク

コメント