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

can't test forward #40

Open
ahuxjz opened this issue Mar 28, 2019 · 3 comments
Open

can't test forward #40

ahuxjz opened this issue Mar 28, 2019 · 3 comments

Comments

@ahuxjz
Copy link

ahuxjz commented Mar 28, 2019

prediction[:,:,:2]+=x_y_offset
RuntimeError: The expanded size of the tensor (507) must match the existing size (13520) at non-singleton dimension 1

@harpalsahota
Copy link

Got a similar error, but mine is happens in the predict_transform method, when calling prediction.view

RuntimeError: shape '[1, 255, 3025]' is invalid for input of size 689520

Printing the inputs to prediction.view I get:

batch_size, bbox_attrs, num_anchors, grid_size
1 85 3 13
1 85 3 26
1 85 3 55 <--- crashes here

@harpalsahota
Copy link

harpalsahota commented Jun 11, 2019

I think the issue is in the cfg file. The original height and width was 416 but now is 608. So

stride = in_dim // prediction.size(2)

went from 416 // 52 = 8 to 608 // 52 = 11. Therefore:

grid_size = in_dim // stride

went from 416 // 8 = 52 to 608 // 11 = 55. The latter has the incorrect grid size this causing the shape error here:

prediction = prediction.view(batch_size, bbox_attrs * num_anchors, grid_size * grid_size)

Would the correct thing to do be changing the height and width back to 416?

@AbanoubMamdouh
Copy link

@harpalsahota The most important thing is that the input image dimensions which you resize in the function:

get_test_input()

matches with the dimensions of the image in the cfg file. I've tried it myself and it worked fine.

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

3 participants