Fix broken test, repvgg block doesn't have attn_last attr.

more_attn
Ross Wightman 4 years ago
parent 742c2d5247
commit f615474be3

@ -573,9 +573,8 @@ class RepVggBlock(nn.Module):
if isinstance(m, nn.BatchNorm2d): if isinstance(m, nn.BatchNorm2d):
nn.init.normal_(m.weight, .1, .1) nn.init.normal_(m.weight, .1, .1)
nn.init.normal_(m.bias, 0, .1) nn.init.normal_(m.bias, 0, .1)
for attn in (self.attn, self.attn_last): if hasattr(self.attn, 'reset_parameters'):
if hasattr(attn, 'reset_parameters'): self.attn.reset_parameters()
attn.reset_parameters()
def forward(self, x): def forward(self, x):
if self.identity is None: if self.identity is None:

@ -110,4 +110,4 @@ class CecaModule(nn.Module):
return x * y.expand_as(x) return x * y.expand_as(x)
CircularEfficientChannelAttn = CecaModule CircularEfficientChannelAttn = CecaModule

Loading…
Cancel
Save