-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Labels
Description
Hi guys,
I think there is a small bug in the "_make_layer(self, block, planes, blocks, stride=1)" function (in charge of generating residual blocks at certain resolution) in the ResNet model. This function will just simply discard the odd number of rows and columns in the feature maps in the identity path at the first residual block in a resolution stage when the stride=2 (the case where feature maps get downsampled by 2).
def _make_layer(self, block, planes, blocks, stride=1):
downsample = None
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
#this 1x1 conv with stride 2 will simply discard the odd number of rows and columns in the feature maps in the identity path
conv1x1(self.inplanes, planes * block.expansion, stride),
nn.BatchNorm2d(planes * block.expansion),
)
Please let me know what do you think.
Reactions are currently unavailable