Skip to content

Commit 666de85

Browse files
committed
Move stride in EdgeResidual block to 3x3 expansion conv. Fix #414
1 parent 3b57490 commit 666de85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

timm/models/efficientnet_blocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ def __init__(self, in_chs, out_chs, exp_kernel_size=3, exp_ratio=1.0, fake_in_ch
350350
self.drop_path_rate = drop_path_rate
351351

352352
# Expansion convolution
353-
self.conv_exp = create_conv2d(in_chs, mid_chs, exp_kernel_size, padding=pad_type)
353+
self.conv_exp = create_conv2d(
354+
in_chs, mid_chs, exp_kernel_size, stride=stride, dilation=dilation, padding=pad_type)
354355
self.bn1 = norm_layer(mid_chs, **norm_kwargs)
355356
self.act1 = act_layer(inplace=True)
356357

@@ -362,8 +363,7 @@ def __init__(self, in_chs, out_chs, exp_kernel_size=3, exp_ratio=1.0, fake_in_ch
362363
self.se = None
363364

364365
# Point-wise linear projection
365-
self.conv_pwl = create_conv2d(
366-
mid_chs, out_chs, pw_kernel_size, stride=stride, dilation=dilation, padding=pad_type)
366+
self.conv_pwl = create_conv2d(mid_chs, out_chs, pw_kernel_size, padding=pad_type)
367367
self.bn2 = norm_layer(out_chs, **norm_kwargs)
368368

369369
def feature_info(self, location):

0 commit comments

Comments
 (0)