Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

keras 2.0 concat error in ssd.train ipython #60

Open
zhyhan opened this issue Mar 17, 2017 · 6 comments
Open

keras 2.0 concat error in ssd.train ipython #60

zhyhan opened this issue Mar 17, 2017 · 6 comments

Comments

@zhyhan
Copy link

zhyhan commented Mar 17, 2017

When I code the ssd.train.ipython in notebook, the follwing error will appear, i has upgrade the keras 2.0 version:
ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 38, 38, 512), (None, 19, 19, 1024), (None, 10, 10, 512), (None, 5, 5, 256), (None, 3, 3, 256), (None, 1, 1, 256)]

@zhyhan zhyhan changed the title keras 2.0 concat erroe keras 2.0 concat error in ssd.train ipython Mar 17, 2017
@rykov8
Copy link
Owner

rykov8 commented Mar 17, 2017

@hzycn you need to rename get_output_shape to compute_output_shape in custom layers. However there might be other issues, as the implementation was not tested with Keras 2 api.

@zhyhan
Copy link
Author

zhyhan commented Mar 17, 2017

Thank you @rykov8 , I changed the get_output_shape to computer_output_shape in
ssd_layers.py, but it still appears same issues.

@rykov8
Copy link
Owner

rykov8 commented Mar 17, 2017

@hzycn is it a missprint in your comment? You need compute_output_shape, not computer_output_shape

@sruu72
Copy link

sruu72 commented Mar 22, 2017

Works after @rykov8 suggestion implemented, and it seems to be only necessary change.

@BenMacKenzie
Copy link

i'm having the same issue. not sure i am interpreting the suggested fix correctly though:

in Class PriorBox

change:
def get_output_shape_for(self, input_shape):
to
def compute_output_shape_for(self, input_shape):

???

@rykov8
Copy link
Owner

rykov8 commented Apr 10, 2017

@BenMacKenzie not exactly. You need to rename

def get_output_shape_for(self, input_shape):
    ...

to

def compute_output_shape(self, input_shape):
    ...

It's just a Keras 2.0 change in API.

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

No branches or pull requests

4 participants