keras画出模型结构图
安装相关依赖包
pip install pydot #尽量1.2.3版本
运行代码
from keras.utils import plot_model
from keras.models import load_model
model=load_model("near_term_best.h5")
plot_model(model,to_file="model.png",show_shapes=True)
如果提示错误 FileNotFoundError:“dot.exe” not found in path 或者 Graphviz相关粑拉粑拉的问题,请移步我的另外一篇博客。 老卫带你学—pydot运行出现:FileNotFoundError:“dot.exe” not found in path 或者 pydot failed to call GraphViz
运行成功之后: