You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for sharing this project with us! I am curious why did you change the default AdaptiveAvgPool2d of ResNet to AvgPool2d. How does this change affect the performance?
AvgPool2d is used in previous version of Pytorch's official implementation. Now they switch to AdaptiveAvgPool2d. I guess it's essentially the same in my case as the feature map before the pooling layer is right 7x7, please correct me if I am wrong.
No, it might only be the same for your current code since you resize the input data to 224x224 pixels.
The adaptive version ensures a predefined output shape whereas the normal version just pools the input features according to kernel size and stride.
This can be very handy for changing the input resolution of the image with keeping the output feature size the same.
Thanks for pointing this out. That's what I mean, since the standard input is 224x224, then the size before the final pooling layer is always 7x7. Therefore in this case, both are essentially the same. It might be different in other resolutions, though.
Sorry for not being very clear at the first place.
Hi
Thank you for sharing this project with us! I am curious why did you change the default
AdaptiveAvgPool2d
of ResNet toAvgPool2d
. How does this change affect the performance?Your
AvgPool2d
layer:https://github.com/HobbitLong/CMC/blob/master/models/resnet.py#L124
Pytorch's
AdaptiveAvgPool2d
layer:https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py#L153
The text was updated successfully, but these errors were encountered: