diff --git a/models.py b/models.py index dea75221..905797d2 100755 --- a/models.py +++ b/models.py @@ -28,7 +28,7 @@ def create_modules(module_defs, img_size): out_channels=filters, kernel_size=size, stride=stride, - padding=(size - 1) // 2 if mdef['pad'] else 0, + padding=size // 2 if mdef['pad'] else 0, groups=mdef['groups'] if 'groups' in mdef else 1, bias=not bn)) else: # multiple-size conv diff --git a/utils/layers.py b/utils/layers.py index 6424fba7..dce3fed2 100644 --- a/utils/layers.py +++ b/utils/layers.py @@ -65,7 +65,7 @@ class MixConv2d(nn.Module): # MixConv: Mixed Depthwise Convolutional Kernels ht out_channels=ch[g], kernel_size=k[g], stride=stride, - padding=(k[g] - 1) // 2, # 'same' pad + padding=k[g] // 2, # 'same' pad dilation=dilation, bias=bias) for g in range(groups)])