Ubuntu下keras可视化遇到pydot&graphviz无法导入问题

本文介绍如何使用Keras的plot_model函数结合graphviz实现深度学习模型的可视化,包括所需模块的安装与环境变量配置方法。

keras.utils.vis_utils模块提供了画出Keras模型的函数(利用graphviz)

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

安装如下模块:

pip install pydot-ng 
pip install graphviz 
pip install pydot 

重启Anaconda 依然报错:

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

需配置环境变量, stackoverflow中查到解决方法:

conda install python-graphviz

利用 conda 解决依赖问题。

原链接:
添加链接描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值