From 666de85cf19ea0c6bc506b016bf6934a213c29a6 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Sun, 7 Feb 2021 22:10:18 -0800 Subject: [PATCH] Move stride in EdgeResidual block to 3x3 expansion conv. Fix #414 --- timm/models/efficientnet_blocks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/timm/models/efficientnet_blocks.py b/timm/models/efficientnet_blocks.py index d7421ff4..5d9141fb 100644 --- a/timm/models/efficientnet_blocks.py +++ b/timm/models/efficientnet_blocks.py @@ -350,7 +350,8 @@ class EdgeResidual(nn.Module): self.drop_path_rate = drop_path_rate # Expansion convolution - self.conv_exp = create_conv2d(in_chs, mid_chs, exp_kernel_size, padding=pad_type) + self.conv_exp = create_conv2d( + in_chs, mid_chs, exp_kernel_size, stride=stride, dilation=dilation, padding=pad_type) self.bn1 = norm_layer(mid_chs, **norm_kwargs) self.act1 = act_layer(inplace=True) @@ -362,8 +363,7 @@ class EdgeResidual(nn.Module): self.se = None # Point-wise linear projection - self.conv_pwl = create_conv2d( - mid_chs, out_chs, pw_kernel_size, stride=stride, dilation=dilation, padding=pad_type) + self.conv_pwl = create_conv2d(mid_chs, out_chs, pw_kernel_size, padding=pad_type) self.bn2 = norm_layer(out_chs, **norm_kwargs) def feature_info(self, location):