gpt4 book ai didi

python - theano 打印 pydotprint - 运行时错误 : failed to import pydot

转载 作者:行者123 更新时间:2023-12-01 09:33:16 24 4
gpt4 key购买 nike

我正在尝试运行此脚本 https://github.com/dennybritz/nn-theano/blob/master/nn-theano.ipynb它使用 theano 实现神经网络。

一切都很顺利,直到我到达牢房:

theano.printing.pydotprint(forward_prop, var_with_name_simple=True, compact=True, outfile='img/nn-theano-forward_prop.png', format='png')
SVG(theano.printing.pydotprint(forward_prop, var_with_name_simple=True, compact=True, return_image=True, format='svg'))

然后我收到此错误:

RuntimeError                              Traceback (most recent call last)
<ipython-input-11-db44e43f05ee> in <module>()
----> 1 theano.printing.pydotprint(forward_prop, var_with_name_simple=True, compact=True, outfile='img/nn-theano-forward_prop.png', format='png')
2 SVG(theano.printing.pydotprint(forward_prop, var_with_name_simple=True, compact=True, return_image=True, format='svg'))

~\Anaconda3\lib\site-packages\theano\printing.py in pydotprint(fct, outfile, compact, format, with_ids, high_contrast, cond_highlight, colorCodes, max_label_size, scan_graphs, var_with_name_simple, print_output_file, return_image) 781 " and either pydot or pydot-ng for " 782 "pydotprint to work.", --> 783 pydot_imported_msg) 784 785 g = pd.Dot()

RuntimeError: ('Failed to import pydot. You must install graphviz and either pydot or pydot-ng for `pydotprint` to work.', 'An error happened while importing/trying pydot: (2, \'"dot.exe" not found in path.\', None, 2, None)')

我已经阅读了 Stack 上的其他问题,并尝试通过 https://graphviz.gitlab.io/ 安装 graphviz

我安装了 pydot、pydotplus、graphviz (2.38.0) 和 python-graphviz (0.8.2)。我正在使用最近更新的 Anaconda Navigator。Python 3.6.4Windows 10 32 位。

最佳答案

GraphViz 可执行文件需要位于 $PATH 变量中,pydot 才能找到它们。请参阅:https://stackoverflow.com/a/47209738/1959808

pydotpluspydot 的一个未维护的分支。

关于python - theano 打印 pydotprint - 运行时错误 : failed to import pydot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49771377/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com