Ssd_keras: keras 2.0 concat error in ssd.train ipython

Created on 17 Mar 2017  路  6Comments  路  Source: rykov8/ssd_keras

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)]

Most helpful comment

@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.

All 6 comments

@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.

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

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

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

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):

???

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eric82714 picture eric82714  路  4Comments

oarriaga picture oarriaga  路  11Comments

maxlchina picture maxlchina  路  3Comments

emillion92 picture emillion92  路  4Comments

MrXu picture MrXu  路  5Comments