Skip to content

Commit c899ce7

Browse files
committed
Match the maxpool.
1 parent 9d4c24e commit c899ce7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/nets/resnet_v1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def __init__(self, block, layers, num_classes=1000):
118118
bias=False)
119119
self.bn1 = nn.BatchNorm2d(64)
120120
self.relu = nn.ReLU(inplace=True)
121-
# Note that, tf-faster-rcnn use padding 1 maxpool instead of ceil_mode, but it doesn't affect the output much
122-
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=0, ceil_mode=True) # change
121+
# maxpool different from pytorch-resnet, to match tf-faster-rcnn
122+
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
123123
self.layer1 = self._make_layer(block, 64, layers[0])
124124
self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
125125
self.layer3 = self._make_layer(block, 256, layers[2], stride=2)

0 commit comments

Comments
 (0)