Theano的一个关于signal,signal/conv,signal/downsample的错误

安装了Theano和keras之后,准备走段代码出错了,大概意思是:
“Theano is missing signal”,就是说signal模块找不到,我跑到
源代码目录下看是有这个的:

明明有的啊,流泪!!!
只好googl了一下,发现也有人跟我差不多的问题:

Best Answer:
As you can see importing theano also gets us the theano.tensor module, but as tensor.init.py doesn’t import signal for example, the following does not work:

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'

就是说,上层的_init_没有显示的进行import
于是修改文件,tensor/init.py,

最后一行加入:

from theano.tensor import signal

此时再次导入,成功:


我以为一切正常了,谁知道生活又开了个玩笑,是的又出错啦:

AttributeError: 'module' object has no attribute 'conv'
AttributeError: 'module' object has no attribute 'downsample'

说的是signal没有conv和downsample,流泪了!!!
跟上面方法一样,这次修改了init.py,显示导入:

from theano.tensor.signal import conv
from theano.tensor.signal import downsample

这次倒好,直接import theano都出错了!!!!
最后发现可以在代码里面显示的导入上面两行,代码运行正常。

PS:
好像这个错,过几天无故就没了,我的就是过了几天不显示导入都可以直接运行,也不知道是什么原因
有知道的大侠们,烦请告知我一下哈!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值