`pydot` failed to call GraphViz.解决方法

如下所示:

d:\anaconda\envs\tensorflow\lib\site-packages\keras\utils\vis_utils.py in _check_pydot()
     27     except OSError:
     28         raise OSError(
---> 29             '`pydot` failed to call GraphViz.'
     30             'Please install GraphViz (https://www.graphviz.org/) '
     31             'and ensure that its executables are in the $PATH.')

OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH. 

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已经停止开发了,pyhn3.5和 python36已经用不起来。解决方案是 

第一步:先卸载掉已经安装的pydot:
     pip uninstall pydot 

第二步:安装pydotplus
     pip install pydotplus 
然后找到 keras里面的 utils\vis_utils.py,把里面的pydot的都替换成 pydotplus

如果上述步骤都完成了还是报刚开的错误的话,那就重新安装一下graphviz,即:#conda install graphviz

 

评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值