learnopencv icon indicating copy to clipboard operation
learnopencv copied to clipboard

Why is the kernel_size of the global average pooling layer 7x7 in fully convNet for image classification? How to decide it?

Open sisrfeng opened this issue 2 years ago • 0 comments

        # resNet18 in pytorch use `AdaptiveAvgPool2d`,  which collapses the feature maps 
        # of any size to the predefined one.
        self.avgpool = nn.AvgPool2d((7,7))  # Replace AdaptiveAvgPool2d with standard AvgPool2d

I change it to 9x9, 11x11 or other values, the results seem similar.
What is the beset kernel_size given an input image wish shape 3xHxW

sisrfeng avatar Dec 31 '21 05:12 sisrfeng