Mobilenet-ssd-keras icon indicating copy to clipboard operation
Mobilenet-ssd-keras copied to clipboard

Error while concatenating mbox_conf_softmax, mbox_loc, mbox_priorbox

Open amapic opened this issue 5 years ago • 5 comments

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

amapic avatar Nov 14 '19 14:11 amapic

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.

apichat583 avatar Nov 28 '19 18:11 apichat583

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

diefish2 avatar Nov 30 '19 01:11 diefish2

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 [email protected] 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 .

amapic avatar Nov 30 '19 18:11 amapic

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.

zhangw864680355 avatar Dec 10 '19 07:12 zhangw864680355

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

amapic avatar Dec 10 '19 09:12 amapic