ubuntu系统下,在使用keras可视化model的时候,有时会遇到函数 plot_model的问题,在确保自己安装了graphviz工具情况下,如果遇到这个问题:
OSError: pydot
failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
可以采用如下方式解决:
提示的错误是指没有向系统添加环境变量,解决方法:
1、ctrl + Alt + T:打开命令行
2、输入:
sudo gedit ~/.bashrc
在文件末尾编辑:
export PATH=/usr/bin/dot:$PATH,保存,退出
3、source ~/.bashrc
这样就完成了添加(亲测有效)
参考链接:
1、查找ubuntu包的安装路径:https://blog.csdn.net/Micheal_J/article/details/7386623
2、Graphviz工具的路径添加:https://blog.csdn.net/adaptiver/article/details/53701015