OSError: pydot
failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
环境:win 10,,,python3.7
刚安装完graphviz-2.38
windows系统下,在 keras里面绘图时,如果没有导入过pydot和 graphviz,在运行时会报告" Failed to import pydot. You must install pydot
"类似的错误,并且提示你 pip install pydot
,可是 pip install
之后,又会提示你找不到 graphviz。
然后 pip install graphv
后发现没用,网上搜索的解决方案大都是直接官网下载 graphy后并且加入系统path变量,但是最后如果倒霉的话有可能发现还是报同样的错。还是会报告 pydot找不到 graphviz( pydot failed to call Graphviz
)
其实是pydot的原因,由于pydot已经停止开发了,python3.7已经用不起来。
解决办法:
第一步:先卸载掉已经安装的pydot:
pip uninstall pydot
第二步:安装pydotplus
pip install pydotplus
然后找到 keras里面的 utils\vis_utils.py
,把里面的pydot的都替换成 pydotplus