Python Theano缺少signal.conv模块
My theano没有Python Theano缺少signal.conv模块,python,theano,Python,Theano,My theano没有信号.conv模块 import theano.tensor.signal.conv >>AttributeError: 'module' object has no attribute 'conv' 我的theano版本是“0.7.0”。我试着升级,正在执行pip安装theano--upgrade,它告诉我我已经是最新的了。如何获取conv模块 PS:我甚至通过sudopip安装--upgrade--no-depsgit更新到了开发版本+git://gith
信号.conv
模块
import theano.tensor.signal.conv
>>AttributeError: 'module' object has no attribute 'conv'
我的theano版本是“0.7.0”。我试着升级,正在执行pip安装theano--upgrade
,它告诉我我已经是最新的了。如何获取conv模块
PS:我甚至通过sudopip安装--upgrade--no-depsgit更新到了开发版本+git://github.com/Theano/Theano.git
仍然没有信号。conv
如果我做了theano.tensor.signal.\uuuu file.\uuuuuu
我会得到文件/usr/local/lib/python2.7/dist packages/theano/tensor/signal/\uuuuu init.\uuuuuuuuu.py的路径,我可以成功调用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位,python 2.7.6,正如上面的评论所写,我认为这是由于张量没有隐式导入信号
,甚至信号.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'>
导入子模块后,它会执行以下操作:
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'>
[5]中的:导入ano.tensor.signal.conv
In[6]:无张量信号
出[6]:
在[7]中:theano.tensor.signal.conv
出[7]:
我刚刚安装了Theano的0.7.0版本,该模块对我来说很好。theano.tensor.signal.\uuuuu文件\uuuu
的结果是否与安装了no的位置匹配?你能用一个virtualenv重现这个问题,并在你的问题中添加重现这个问题的命令列表吗?@DanGetz我编辑了我的问题。你有没有试过导入no
,然后导入no.tensor.signal.conv
(tensor
不会隐式导入signal
或signal.conv>)?@JörnHees不,我没有。成功了!非常感谢,我想我对导入如何工作感到困惑,这就是为什么你应该总是尝试你在问题中发布的代码:)即使你认为你已经用另一种方式尝试了“相同的事情”。你可能会找到你的答案!我只能在8小时内颁发赏金。。我以后再做
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'>