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

ssd300MobileNet layer concatenate error #30

Open
rkuo2000 opened this issue Jan 10, 2020 · 1 comment
Open

ssd300MobileNet layer concatenate error #30

rkuo2000 opened this issue Jan 10, 2020 · 1 comment

Comments

@rkuo2000
Copy link

rkuo2000 commented Jan 10, 2020

when I use SSD.ipynb or SSD_Train.ipynb, (keras-2.3.1 or 2.1.5 both failed)
model=model = SSD(input_shape, num_classes=NUM_CLASSES) always cause Error as below:

ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 1917, 4), (None, 1917, 21), (None, 114432, 8)]

error is caused by merge of the 3 nets at line #186 of ssd300MobileNet.py
net['predictions'] = concatenate([net['mbox_loc'],net['mbox_conf'],net['mbox_priorbox']],axis=2,name='predictions')

how to fix the shape mismatch of these 3 nets ?

@rkuo2000 rkuo2000 changed the title ssd300MobileNet error ssd300MobileNet layer concatenate error Jan 10, 2020
@rkuo2000
Copy link
Author

rkuo2000 commented Jan 10, 2020

The fix is to modify ssd_layers.py line #32 and #84 :
if K.image_dim_ordering() == 'tf': to if K.image_data_format() == 'channels_last':
Then it runs !

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

1 participant