![](/img/trans.png)
[英]Theano AttributeError: 'module' object has no attribute 'relu'
[英]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
。
我通過使用解決了
sudo pip install graphviz
sudo apt-get install graphviz
pydot 1.2.3版本可以正常工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.