Skip to content

Commit 4ddde1d

Browse files
committed
Fix two regressions
1 parent a7e8cad commit 4ddde1d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

timm/models/layers/se.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class SEModule(nn.Module):
66

77
def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None,
8-
gate_fn='hard_sigmoid'):
8+
gate_fn='sigmoid'):
99
super(SEModule, self).__init__()
1010
self.avg_pool = nn.AdaptiveAvgPool2d(1)
1111
reduction_channels = reduction_channels or max(channels // reduction, min_channels)

timm/models/res2net.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def forward(self, x):
9999

100100
spx = torch.split(out, self.width, 1)
101101
spo = []
102-
sp = spx[0]
102+
sp = spx[0] # redundant, for torchscript
103103
for i, (conv, bn) in enumerate(zip(self.convs, self.bns)):
104-
if self.is_first:
104+
if i == 0 or self.is_first:
105105
sp = spx[i]
106106
else:
107107
sp = sp + spx[i]

0 commit comments

Comments
 (0)