From 4ddde1d3a45ef7848a5f6fd4d87676ba1141246c Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Fri, 5 Jun 2020 11:04:51 -0700 Subject: [PATCH] Fix two regressions --- timm/models/layers/se.py | 2 +- timm/models/res2net.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/timm/models/layers/se.py b/timm/models/layers/se.py index 83389fc5..4e47cc96 100644 --- a/timm/models/layers/se.py +++ b/timm/models/layers/se.py @@ -5,7 +5,7 @@ from .create_act import get_act_fn class SEModule(nn.Module): def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None, - gate_fn='hard_sigmoid'): + gate_fn='sigmoid'): super(SEModule, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) reduction_channels = reduction_channels or max(channels // reduction, min_channels) diff --git a/timm/models/res2net.py b/timm/models/res2net.py index b095de30..c3773dd5 100644 --- a/timm/models/res2net.py +++ b/timm/models/res2net.py @@ -99,9 +99,9 @@ class Bottle2neck(nn.Module): spx = torch.split(out, self.width, 1) spo = [] - sp = spx[0] + sp = spx[0] # redundant, for torchscript for i, (conv, bn) in enumerate(zip(self.convs, self.bns)): - if self.is_first: + if i == 0 or self.is_first: sp = spx[i] else: sp = sp + spx[i]