python lasagne ImportError cannot import BatchNormLayer
Asked Answered
I

1

5

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?

Ines answered 18/3, 2016 at 15:42 Comment(1)
You should probably file an issue in the Github repo instead of asking here.Strip
I
10

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.

Ines answered 19/3, 2016 at 1:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.