问题描述
我在Windows 10计算机上使用python 3.6.3.我通过以下方式通过pip install安装了pydot和graphviz:
py -m pip install pydot
py -m pip install graphviz
我还访问了graphviz网站,并在此处下载并安装了Windows版本: http://www. graphviz.org/Download_windows.php 默认安装到程序文件(x86).但是,当我在keras中绘制模型时,仍然收到错误消息,提示我必须安装pydot和graphviz,并且导入失败.我能做
import pydot
import graphviz
在我的python控制台上
很好,它们没有抛出任何错误.为了能够绘制我的神经网络,我还应该做些什么?
已安装GraphViz可执行文件(dot
,neato
等)的路径必须位于 PATH
环境变量,以便pydot
可以找到它们. pydot
曾经在早期版本中搜索那些可执行文件,但不再有用. /p>
也:
-
pydot
是Python软件包. - GraphViz 是用C 编写,用于计算图形布局
-
graphviz
是一个与pydot
完全无关的Python软件包.这两个Python程序包彼此之间没有任何交互. (与GraphViz一起)安装其中之一就足够了.
另请参阅:
- https://github.com/erocarrera/pydot/issues/126
- https://github.com/erocarrera/pydot/commit/812e3c40dac1e0225391481073c commitcomment-18236709
- https://github.com/erocarrera/pydot/commit/812e3c40dac1e0225391481073c commitcomment-18222580
以及从那里的链接.
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
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
on my python console just fine, they throw no errors. What else should I do to be able to graph my neural net?
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.
Also:
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).
See also:
- https://github.com/erocarrera/pydot/issues/126
- https://github.com/erocarrera/pydot/commit/812e3c40dac1e0225391481073c64da5bafba93e#commitcomment-18236709
- https://github.com/erocarrera/pydot/commit/812e3c40dac1e0225391481073c64da5bafba93e#commitcomment-18222580
and links from there.
这篇关于keras plot_model告诉我安装pydot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!