Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name Container #16

Open
VRM1 opened this issue Dec 14, 2018 · 1 comment
Open

cannot import name Container #16

VRM1 opened this issue Dec 14, 2018 · 1 comment

Comments

@VRM1
Copy link

VRM1 commented Dec 14, 2018

Hi,

I am trying to execute your code for the following versions of theano, keras and sklearn

Keras - '2.2.4'
Theano - '1.0.3'
sklearn - '0.20.1'

I had to make some modifications to your VaDE.py code by changing GMM to GaussianMixture. Now, when replacing the training.py at keras/engine/ with the one included in your code results in the following error. Can you please help me out with this?

Using Theano backend.
Traceback (most recent call last):
File "VaDE.py", line 14, in
from keras.callbacks import Callback
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/init.py", line 3, in
from . import utils
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/utils/init.py", line 27, in
from .multi_gpu_utils import multi_gpu_model
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/utils/multi_gpu_utils.py", line 7, in
from ..layers.merge import concatenate
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/layers/init.py", line 4, in
from ..engine.base_layer import Layer
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/engine/init.py", line 8, in
from .training import Model
File "/Users/vineeth/anaconda2/envs/DeepLearning/lib/python2.7/site-packages/keras/engine/training.py", line 15, in
from .topology import Container
ImportError: cannot import name Container

I appreciate your help in advance.

Thanks
Vineeth

@hitokun-s
Copy link

It seems that 'Container' has changed into 'Network' in keras >= 2.2.
So change your code from

from keras.engine.topology import Container

to

from keras.engine.network import Network

and use 'Network' as same as 'Container'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants