Haohan Wang
Haohan Wang

Reputation: 607

python lasagne ImportError cannot import BatchNormLayer

When I try to play with the code here, I met a very strange error. Every other modules can be imported properly, except for one.

Specifically, the error is:

ImportError: cannot import name BatchNormLayer

from the file here. And the lasagne_extensions.layers is as following:

from .density_layers import *
from lasagne.layers import *
from parmesan.layers import *

So, I believe the problem should be that I didn't install lasagne or parmesan properly.

I have tried to upgrade the relevant modules including numpy, scipy, theano and lasagne to newest version with pip install --upgrade respectively. There is no pip install support for parmesan, so I downloaded it and installed it again. However, the error remains.

Can anyone give me some advice about what I should look into?

Upvotes: 5

Views: 7097

Answers (1)

Haohan Wang
Haohan Wang

Reputation: 607

The solution is to install the cutting-edge version, and pip install --upgrade does not do that.

But the problem can be solved by:

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

Details are here.

Upvotes: 10

Related Questions