2015-05-21 94 views
2

我theano没有signal.conv模块Theano缺少signal.conv模块

import theano.tensor.signal.conv 
>>AttributeError: 'module' object has no attribute 'conv' 

我theano的版本是 '0.7.0'。我试图升级pip install theano --upgrade,它告诉我我已经是最新的了。我如何获得转换模块?

PS:我甚至通过做sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git更新到开发版本,仍然没有signal.conv

如果我做theano.tensor.signal.__file__我得到了我的文件conv.py和downsample.py同一文件夹中的文件路径/usr/local/lib/python2.7/dist-packages/theano/tensor/signal/__init__.pyc我可以sucessfuly打电话theano.tensor.signal.downsample但不theano.tensor.signal.conv

----安装在VIRTUALENV ----

我试图重现上的virtualenv错误:

virtualenv --no-site-packages myenv 
cd myenv 
source bin/activate 
pip install numpy 
pip install scipy 
pip install theano 
python 
import theano 
theano.tensor.signal.conv 
>>AttributeError: 'module' object has no attribute 'conv' 

我对Ubuntu的14.04 64位,蟒蛇2.7.6

+0

我刚刚安装了0.7.0版本的Theano,并且该模块对我来说很好。 'theano.tensor.signal .__ file__'的结果是否匹配'pip'安装Theano的结果?你能否用virtualenv重现这个问题,并在问题中添加重现问题的命令列表? –

+0

@DanGetz我编辑了我的问题。 –

+1

你试过'import theano'然后'import theano.tensor.signal.conv'('tensor'不会隐式地导入'signal'或'signal.conv')? –

回答

3

写在上面的评论,我觉得这是由tensor不会隐进口signal甚至signal.conv引起的,因此,你必须做进口自己使用它:

In [1]: import theano 

In [2]: theano.tensor 
Out[2]: <module 'theano.tensor' from '/usr/local/lib/python2.7/site-packages/theano/tensor/__init__.pyc'> 

正如你可以看到进口theano也得到我们theano.tensor模块,但tensor.__init__.py例如不导入signal,下面不工作:

In [3]: theano.tensor.signal 
--------------------------------------------------------------------------- 
AttributeError       Traceback (most recent call last) 
<ipython-input-3-53b46c46cb25> in <module>() 
----> 1 theano.tensor.signal 

AttributeError: 'module' object has no attribute 'signal' 

In [4]: theano.tensor.signal.conv 
--------------------------------------------------------------------------- 
AttributeError       Traceback (most recent call last) 
<ipython-input-4-b2a3482abaed> in <module>() 
----> 1 theano.tensor.signal.conv 

AttributeError: 'module' object has no attribute 'signal' 

导入SUBM后模块它:

In [5]: import theano.tensor.signal.conv 

In [6]: theano.tensor.signal 
Out[6]: <module 'theano.tensor.signal' from '/usr/local/lib/python2.7/site-packages/theano/tensor/signal/__init__.pyc'> 

In [7]: theano.tensor.signal.conv 
Out[7]: <module 'theano.tensor.signal.conv' from '/usr/local/lib/python2.7/site-packages/theano/tensor/signal/conv.pyc'> 
+0

我只能在8小时内奖赏赏金。我会在之后完成 –