diff --git a/models_vovnet/vovnet.py b/models_vovnet/vovnet.py index a11d7f0..16c96cf 100644 --- a/models_vovnet/vovnet.py +++ b/models_vovnet/vovnet.py @@ -73,20 +73,18 @@ def __init__(self, OrderedDict(conv1x1(in_channel, concat_ch, module_name, 'concat'))) def forward(self, x): - identity_feat = x - output = [] - output.append(x) + output = [x] for layer in self.layers: x = layer(x) output.append(x) x = torch.cat(output, dim=1) - xt = self.concat(x) + x = self.concat(x) if self.identity: - xt = xt + identity_feat + x = x + output[0] - return xt + return x class _OSA_stage(nn.Sequential): @@ -221,4 +219,4 @@ def vovnet27_slim(pretrained=False, progress=True, **kwargs): progress (bool): If True, displays a progress bar of the download to stderr """ return _vovnet('vovnet27_slim', [64, 80, 96, 112], [128, 256, 384, 512], - [1,1,1,1], 5, pretrained, progress, **kwargs) \ No newline at end of file + [1,1,1,1], 5, pretrained, progress, **kwargs)