python plot_の使用Modelはモデル図を描画します(エラー`pydot`failed to call GraphViz.Please install GraphViz(https://www.gr)

1109 ワード

plot_の使用モデルはまず別の2つのライブラリ、graphvizとpydotをインストールしなければなりません.
pip install graphviz
pip install pydot

コンピュータもgraphvizをインストールし、リンクをダウンロードしなければなりません.http://183.240.9.20/softdl.360tpcdn.com/graphviz/graphviz_2.39.20150331.msi
#  graphviz        
import os
from keras.utils.vis_utils import plot_model

#  graphviz     (os.pathsep + 'graphviz      bin  ')
os.environ["PATH"] += os.pathsep + 'E:/New Folder/bin/'

#     
plot_model(model,to_file = 'model.png',show_shapes = True)

環境変数を追加しないと、`pydot`failed to call GraphVizとエラーが発生します.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
python使用plot_model绘制模型图(解决报错`pydot` failed to call GraphViz.Please install GraphViz (https://www.gr)_第1张图片