簡體   English   中英

導入theano:AttributeError:'模塊'對象沒有屬性'find_graphviz'

[英]Importing theano: AttributeError: 'module' object has no attribute 'find_graphviz'

在Python中運行import theano時,出現以下錯誤消息:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 74, in <module>
    from theano.printing import pprint, pp
  File "/usr/local/lib/python2.7/dist-packages/theano/printing.py", line 35, in <module>
    if pd.find_graphviz():
AttributeError: 'module' object has no attribute 'find_graphviz'

可能是什么問題,以及如何解決?

我在Python 2.7.6 x64的Ubuntu 14.04.4 LTS x64上使用Theano 0.8.2。


我嘗試失敗:

  • sudo apt-get install -y graphviz libgraphviz-dev

pydot 1.2.x版本中, 不建議使用 find_graphviz函數。 要解決此問題,您應該在此處https://github.com/erocarrera/pydot/tree/v1.1.0安裝pydot 1.1.0版本。 對我來說這是工作。 可能有幫助。

我通過安裝pydot-ng解決-> $ pip install pydot-ng

由於某種原因,Python模塊pydot造成了問題:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pydot
>>> pydot.find_graphviz()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'find_graphviz'

我使用的是pydot 1.2.2。

我使用sudo pip uninstall -y pydot卸載了它,然后能夠成功import theano

錯誤報告: https//github.com/Theano/Theano/issues/4759

我通過使用解決了

sudo pip install graphviz
sudo apt-get install graphviz

pydot 1.2.3版本可以正常工作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM