-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Max pooling issue when stride is 1 #62
Comments
I think it may be |
You can simply do this to temporarily bypass this issue: if pool_size == 5:
model = nn.MaxPool2d(5, 1, padding=2)
elif pool_size == 9:
model = nn.MaxPool2d(9, 1, padding=4)
else: # pool_size == 13
model = nn.MaxPool2d(13, 1, padding=6) |
This is result of the difference between darknet and pytorch's implementation of padding. darknet parser.c
darknet maxpool_layer.c
It can be found that the darknet's pad parameter is set to '1' and the padding is 'SAME' in tensorflow is the same. So I do n’t have a beautiful way to deal with it.:sweat: |
Make the solution perfect and universal is difficult but the minimum requirement is that you make YOLOv4/v3 correct. |
In the original DarkNet model, the there are 3 max pooling layers of kernel size: 5, 9, 13, and stride is 1 for all of them.
But the solution in darknet2pytorch is confusing.
I don't know why kernel size is set to 2 when stride is 1 because it would not be mathematical identical.
and
The text was updated successfully, but these errors were encountered: