ManishSoni1908 / Mobilenet-ssd-keras

A Keras port of Single Shot MultiBox Detector as Mobilenet as a Backbone
62 stars 24 forks source link

Error while concatenating mbox_conf_softmax, mbox_loc, mbox_priorbox #4

Open amapic opened 4 years ago

amapic commented 4 years ago

Hi,

Sorry to bother you, I am stuck on this :

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

The mbox_priorbox tensor has a different shape. Do you know why ?

Thanks, have a good day

apichat583 commented 4 years ago

it's ok. I change K.image_dim_ordering() == 'tf' to K.image_data_format=="channels_first' and it works. It'a problem of conversion between python 2 and 3.

diefish2 commented 4 years ago

I am having the same problems ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 1208, 100), (None, 1208, 4), (None, 2928, 8)] and I tried change tf to channels_first it's still not working. Anyone could help

Thank you

amapic commented 4 years ago

How many change did you do ? Did you also change the image_dim_ordering ? What is your version of tf and keras and python ?

Le sam. 30 nov. 2019 à 02:03, diefish2 notifications@github.com a écrit :

I am having the same problems ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 1208, 100), (None, 1208, 4), (None, 2928, 8)] and I tried change tf to channels_first it's still not working. Anyone could help

Thank you

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManishSoni1908/Mobilenet-ssd-keras/issues/4?email_source=notifications&email_token=ACE7NZBGAAS2QOCZUKXBGM3QWG3VLA5CNFSM4JNMZ5X2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFPWULQ#issuecomment-559901230, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACE7NZCUIU4VGMYQ4OMPE7TQWG3VLANCNFSM4JNMZ5XQ .

zhangw864680355 commented 4 years ago

I am having the same problems ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 1208, 100), (None, 1208, 4), (None, 2928, 8)] and I tried change tf to channels_first it's still not working. Anyone could help

Thank you

In fact, you need to modify in file (“misc/keras_layer_AnchorBoxes.py”) as follow: change K.image_dim_ordering() == 'tf' to K.image_data_format=="channels_last' instead of "channels_first". You can have a try.

amapic commented 4 years ago

You need to do that in every file where image_dim_ordering appears, there is more than one