diff --git a/models/common.py b/models/common.py index 10f6fd6..3c4a0d7 100644 --- a/models/common.py +++ b/models/common.py @@ -13,7 +13,8 @@ class Conv(nn.Module): # Standard convolution def __init__(self, c1, c2, k=1, s=1, g=1, act=True): # ch_in, ch_out, kernel, stride, groups super(Conv, self).__init__() - self.conv = nn.Conv2d(c1, c2, k, s, k // 2, groups=g, bias=False) + p = k // 2 if isinstance(k, int) else [x // 2 for x in k] # padding + self.conv = nn.Conv2d(c1, c2, k, s, p, groups=g, bias=False) self.bn = nn.BatchNorm2d(c2) self.act = nn.LeakyReLU(0.1, inplace=True) if act else nn.Identity()