Theano 缺少 signal.conv 模块
Theano is missing signal.conv module
我的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__
我会在同一文件夹中获得文件 /usr/local/lib/python2.7/dist-packages/theano/tensor/signal/__init__.pyc
的路径 我有文件 conv.py 和 downsample.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
正如上面的评论所写,我认为这是由于 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'
导入子模块后它会做:
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'>
我的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__
我会在同一文件夹中获得文件 /usr/local/lib/python2.7/dist-packages/theano/tensor/signal/__init__.pyc
的路径 我有文件 conv.py 和 downsample.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
正如上面的评论所写,我认为这是由于 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'
导入子模块后它会做:
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'>