Closed ersheng-ai closed 4 years ago
Sorry for bothering you again :-) nn.MaxPool2d is already enough to handle your cases. In line 237 of darknet2pytorch.py Change
nn.MaxPool2d
elif block['type'] == 'maxpool': pool_size = int(block['size']) stride = int(block['stride']) if stride > 1: model = nn.MaxPool2d(pool_size, stride) else: model = MaxPoolStride1(pool_size)
to
elif block['type'] == 'maxpool': pool_size = int(block['size']) stride = int(block['stride']) model = nn.MaxPool2d(kernel_size=pool_size, stride=stride, padding=pool_size//2)
Thanks for your suggestion, it has been modified.
Sorry for bothering you again :-)
nn.MaxPool2d
is already enough to handle your cases. In line 237 of darknet2pytorch.py Changeto