本文介绍了keras plot_model告诉我安装pydot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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可执行文件(dotneato等)的路径必须位于 PATH环境变量,以便pydot可以找到它们. pydot曾经在早期版本中搜索那些可执行文件,但不再有用. /p>

也:

  1. pydot 是Python软件包.
  2. GraphViz 用C 编写,用于计算图形布局
  3. graphviz 是一个与pydot完全无关的Python软件包.这两个Python程序包彼此之间没有任何交互. (与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

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:

  1. pydot is a Python package.
  2. GraphViz is a collection of tools written in C for computing graph layouts
  3. graphviz is a Python package entirely unrelated to pydot. These two Python packages do not interact in any way with each other. Installing one of them should suffice (together with GraphViz).

See also:

and links from there.

这篇关于keras plot_model告诉我安装pydot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 08:15