keras使用pydot画图的问题

from keras.utils import plot_model
plot_model(model, to_file="model.png", show_shapes=True, show_layer_names=True)

上面代码执行处做,Assertion Error

解决方案:

This may help for someone who is looking for For Anaconda on Windows 10 64 Bit, Environment: Windows 10 64 Bit, Python 3.5.2, Anaconda 4.2.0 (64-bit)

前三部分可能不需要:

  1. Download "graphviz-2.38.msi" from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
  2. Execute the "graphviz-2.38.msi" file
  3. Add the graphviz bin folder to the PATH system environment variable (Example: "C:\Graphviz2.38\bin")
  4. Go to Anaconda Prompt using start menu (Make sure to right click and select "Run as Administrator". We may get permission issues if Prompt as not opened as Administrator)
  5. Execute the command: conda install graphviz
  6. Execute the command: pip install git+https://github.com/nlhepler/pydot.git
  7. Execute the command "conda list" and make sure pydot and graphviz modules are listed. 
  8. go to python console, run following codes to check.
    import pydot
    pydot.find_graphviz()
    should show:
    {'dot': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\dot.exe', 'twopi': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\twopi.exe', 'neato': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\neato.exe', 'circo': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\circo.exe', 'fdp': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\fdp.exe', 'sfdp': 'C:\\ProgramData\\Anaconda3\\Library\\bin\\graphviz\\sfdp.exe'}

     

转载于:https://www.cnblogs.com/andy-0212/p/10198820.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值