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

concatenate error #1

Open
akshitac8 opened this issue Jul 15, 2018 · 11 comments
Open

concatenate error #1

akshitac8 opened this issue Jul 15, 2018 · 11 comments

Comments

@akshitac8
Copy link

The other 2 conctenate layer are working but when executing this layer. I get a valueError

mbox_priorbox = concatenate([conv4_3_norm_mbox_priorbox,
                                 fc7_mbox_priorbox,
                                 conv6_2_mbox_priorbox,
                                 conv7_2_mbox_priorbox,
                                 conv8_2_mbox_priorbox,
                                 pool6_mbox_priorbox],
                                 axis=1,
                                 name='mbox_priorbox')

Error:

ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs 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)]

It would be great if I could get a help with this Error.
Thank you :)

@jedichien
Copy link
Owner

Hi @akshitac8 Thanks for your report, I will check this issue today :D

@akshitac8
Copy link
Author

ohkay, Thank you :)

@jedichien
Copy link
Owner

Hi @akshitac8 what version of keras and tensorflow do you use? It can help me to figure it out the problem :)

@jedichien
Copy link
Owner

also I notice that the matrix size of these, [conv4_3_norm_mbox_priorbox,
fc7_mbox_priorbox,
conv6_2_mbox_priorbox,
conv7_2_mbox_priorbox,
conv8_2_mbox_priorbox,
pool6_mbox_priorbox], are not the same as I get.

Have you executed these steps?

conv4_3_norm_mbox_priorbox = PriorBox((300, 300), 30.0, name='conv4_3_norm_mbox_priorbox', 
                                              aspect_ratios=[2], variances=[0.1, 0.1, 0.2, 0.2])(conv4_3_norm)
# fc7
fc7_mbox_priorbox = PriorBox((300, 300), 60.0, name='fc7_mbox_priorbox', max_size=114.0, 
                                  aspect_ratios=[2, 3], variances=[0.1, 0.1, 0.2, 0.2])(fc7)

# conv6_2
conv6_2_mbox_priorbox = PriorBox((300, 300), 114.0, max_size=168.0, 
                                      aspect_ratios=[2, 3], variances=[0.1, 0.1, 0.2, 0.2], name='conv6_2_mbox_priorbox')(conv6_2)

# conv7_2
conv7_2_mbox_priorbox = PriorBox((300, 300), 168.0, max_size=222.0, 
                                      aspect_ratios=[2, 3], variances=[0.1, 0.1, 0.2, 0.2], name='conv7_2_mbox_priorbox')(conv7_2)

# conv8_2
conv8_2_mbox_priorbox = PriorBox((300, 300), 222.0, max_size=276.0, 
                                      aspect_ratios=[2, 3], variances=[0.1, 0.1, 0.2, 0.2], name='conv8_2_mbox_priorbox')(conv8_2)

pool6_reshaped = Reshape((1, 1, 256), name='pool6_reshaped')(pool6)

pool6_mbox_priorbox = PriorBox((300, 300), 276.0, max_size=330.0, aspect_ratios=[2, 3], variances=[0.1, 0.1, 0.2, 0.2], name='pool6_mbox_priorbox')(pool6_reshaped)

@akshitac8
Copy link
Author

keras = 2.0.8
tensorflow = 1.4.0
yes, I have executed the steps and found the shape mismatch error at PriorBox.
I was unable to find the reason why this was happening :(

@jedichien
Copy link
Owner

@akshitac8 Okay, I will figure it out :D

@akshitac8
Copy link
Author

@jedichien Any updates?

@jedichien
Copy link
Owner

@akshitac8 Recenly, I work on the other things. I'll try to find the problem this week as soon as possible :D

@jedichien
Copy link
Owner

@akshitac8 It seems like I got the answer, and thanks for your long waiting. Can you upgrade your keras and tensorflow version to 2.1.5 and 1.7.0 separately? I think it can solve this issue. If you cannot do it, let me know, and I will try to figure out the alternative solution :D

@akshitac8
Copy link
Author

Thank you for the information @jedichien I will try the solution.

@jedichien
Copy link
Owner

@akshitac8 please feel free to let me know if you still cannot run the code. :)

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

2 participants