【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」を研究、仕事、趣味でデータ分析や作業自動化などに活用してきたノウハウを情報発信しています。
筆者の詳しいプロフィールやお問合せはこちらのページまで。
YoutubeX(旧Twitter)でも情報発信中です!

西住技研をフォローする
TensorFlow

コメント