ImportError: No module named downsample

随声附和 提交于 2019-12-04 12:53:14

问题


I am using Theano. The OS is Ubuntu. The Theano is UPTODATE. I am wondering why I am getting by from theano.tensor.signal.downsample import max_pool_2d command.

ImportError: No module named downsample.


回答1:


The downsample module has been moved to pool, so try declaring it as:

from theano.tensor.signal.pool import pool_2d

After changing delete your theano cache with the command:

theano-cache purge



回答2:


update theano and lasagne

pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip

Lasagne vs Theano possible version mismatch (Windows)




回答3:


Try to update the Theano using this link.

pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip



回答4:


Same issue [theano v.0.9.0dev1.dev-2...]; changed

from theano.tensor.signal import downsample
pooled_out = downsample.max_pool_2d( ... )

to

from theano.tensor.signal import pool
pooled_out = pool.pool_2d( ... )

in /lib/python2.7/site-packages/lasagne/layers/pool.py



来源:https://stackoverflow.com/questions/39501152/importerror-no-module-named-downsample

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!