From a51d1073f5497dac5d9165d5504eb245cd77c743 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Wed, 18 Jan 2023 11:21:18 -0800 Subject: [PATCH] Update metaformers.py --- timm/models/metaformers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index c1aa9520..7a41cf2a 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -666,6 +666,7 @@ def checkpoint_filter_fn(state_dict, model): k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k) k = k.replace('downsample.proj', 'downsample.conv') + k = k.replace('patch_embed.proj', 'patch_embed.conv') k = re.sub(r'([0-9]+).([0-9]+)', r'\1.blocks.\2', k) k = k.replace('stages.0.downsample', 'patch_embed') k = re.sub(r'^head', 'head.fc', k)