当前位置: 移动技术网 > IT编程>脚本编程>Python > plot_model 解决报错问题

plot_model 解决报错问题

2020年10月13日  | 移动技术网IT编程  | 我要评论
plt_model 解决报错问题错误合集:1、no model pydot ,you need to ''pip install pydot''2、GraphViz's executables not found3、InvocationException: Program terminated with status: 1. stderr follows: Format: "ps" not recognized. Use one of:==========================

plot_model 解决报错问题

 错误合集:
	1、no model pydot ,you need to ''pip install pydot''
	2、GraphViz's executables not found
	3、InvocationException: Program terminated with status: 1. stderr follows: Format: "ps" not recognized. Use one of: 

=============================================================
1、电脑配置:
win10
python3.7

2、由于pydot 只适用于较低版本,对于python3 以上版本需要
pip install pydot_ng
pip install GraphViz

3、找到
在这里插入图片描述
4、vis_utils.py 修改 将 pydot 全部替换成 pydot_ng
5、官网下载GraphViz软件 并安装
地址:https://www2.graphviz.org/Packages/stable/windows/10/cmake/Release/x64/

6、######### 点击添加 path ############

报错:
InvocationException: Program terminated with status: 1. stderr follows: Format: “ps” not recognized. Use one of:

7、以管理员身份运行 输入dot -v
在这里插入图片描述
8、 输入 dot -v 显示的内容,将红色框框的路径 复制在这里插入图片描述
9、在python 执行窗口输入一下代码:(将以上的添加到环境中)
import os
os.environ[“path”] += os.pathsep + r’C:\Users\dell\anaconda3\Library\bin\graphviz\bin’
####### 路径为刚刚复制的路径,进行相应地修改

10 、试试看 可以用了没?

from keras.utils import plot_model
plot_model(model, to_file=‘model.png’)

11、Congrulations to You
Well done ! Finish

本文地址:https://blog.csdn.net/xie_shun/article/details/109052144

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网