keras plot_model 告诉我安装 pydot [英] keras plot_model tells me to install pydot
问题描述
我在 Windows 10 机器上使用 python 3.6.3.我通过以下方式使用 pip install 安装了 pydot 和 graphviz:
I'm using python 3.6.3 on a windows 10 machine. I installed pydot and graphviz using pip install via:
py -m pip install pydot
py -m pip install graphviz
我也去了graphviz网站,在这里下载并安装了windows版本:http://www.graphviz.org/Download_windows.php 默认安装到程序文件(x86).但是当我在 keras 中绘制我的模型时,我仍然收到错误消息,说我必须安装 pydot 和 graphviz 并且导入失败.我可以
I also went to the graphviz website and downloaded and installed the windows version here: http://www.graphviz.org/Download_windows.php which default installed to program files(x86). But when I go to plot my model in keras, I still get the error saying I have to install pydot and graphviz and that the import failed. I can do
import pydot
import graphviz
在我的 python 控制台上很好,它们没有抛出任何错误.我还应该做什么才能绘制我的神经网络图?
on my python console just fine, they throw no errors. What else should I do to be able to graph my neural net?
推荐答案
安装的 GraphViz 可执行文件(dot
、neato
等)的路径需要位于 PATH
环境变量中,以便pydot
找到它们.pydot
用于搜索早期版本中的那些可执行文件,但 不再是.
The path(s) to the installed GraphViz executables (dot
, neato
, etc.) need to be in the PATH
environment variable, in order for pydot
to find them. pydot
used to search for those executables in earlier versions, but not any more.
还有:
pydot
是一个 Python 包.- GraphViz 是一组工具 用 C 编写 用于计算图形布局
graphviz
是一个与pydot<完全无关的 Python 包/代码>.这两个 Python 包不会以任何方式相互交互.安装其中之一就足够了(连同 GraphViz).
pydot
is a Python package.- GraphViz is a collection of tools written in C for computing graph layouts
graphviz
is a Python package entirely unrelated topydot
. These two Python packages do not interact in any way with each other. Installing one of them should suffice (together with GraphViz).
另见:
- https://github.com/erocarrera/pydot/issues/126
- https://github.com/erocarrera/82025c35c35c35c5c35c5c35c35c35c5c35c35c35c5c64a5bafba93commitcomment-18236709
- https://github.com/erocarrera/82025c5c35c35c5c35c35c35c35c35c5c35c35c35c35c35c35c35c64da5bafba93e#commitcomment-182225e3commitcomment-18222580
和那里的链接.
这篇关于keras plot_model 告诉我安装 pydot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!