ImportError: No module named downsample
Asked Answered
D

4

8

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.

Dais answered 14/9, 2016 at 23:34 Comment(0)
G
5

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
Gutshall answered 14/9, 2016 at 23:47 Comment(7)
theano-cache purge File "<stdin>", line 1 theano-cache purge ^ SyntaxError: invalid syntaxDais
Try doing the following ( code here ) to find the location of the cache, that's what you'll want to delete to make sure the imports are updated.Houle
Thank you. It gives me an address. What is the next?Dais
You'll want to delete the contents, as it's the cache which contains outdated imports.Houle
Thank you. Now. ImportError: No module named Theano.tensor.signal.poolDais
It should be lowercase "theano", not "Theano". As a test try doing the following: gist.github.com/anonymous/8a65c27f4e65e0ed5ad8ce124dab36afHoule
^ did you try lowercase "theano"? If the error persists then you must not have a completely current version -- sudo pip install --upgrade --no-deps theanoHoule
A
8

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)

Acrosstheboard answered 7/7, 2017 at 5:50 Comment(0)
G
5

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
Gutshall answered 14/9, 2016 at 23:47 Comment(7)
theano-cache purge File "<stdin>", line 1 theano-cache purge ^ SyntaxError: invalid syntaxDais
Try doing the following ( code here ) to find the location of the cache, that's what you'll want to delete to make sure the imports are updated.Houle
Thank you. It gives me an address. What is the next?Dais
You'll want to delete the contents, as it's the cache which contains outdated imports.Houle
Thank you. Now. ImportError: No module named Theano.tensor.signal.poolDais
It should be lowercase "theano", not "Theano". As a test try doing the following: gist.github.com/anonymous/8a65c27f4e65e0ed5ad8ce124dab36afHoule
^ did you try lowercase "theano"? If the error persists then you must not have a completely current version -- sudo pip install --upgrade --no-deps theanoHoule
C
1

Try to update the Theano using this link.

pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
Concrescence answered 15/6, 2017 at 8:54 Comment(0)
N
1

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

Nerveless answered 8/1, 2018 at 3:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.