Update metaformers.py

This commit is contained in:
Fredo Guan 2023-01-12 11:36:18 -08:00
parent 087a451337
commit 2a9f93c064

View File

@ -779,6 +779,7 @@ def checkpoint_filter_fn(state_dict, model):
for k, v in state_dict.items(): for k, v in state_dict.items():
k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k) k = re.sub(r'downsample_layers.([0-9]+)', r'stages.\1.downsample', k)
k = re.sub(r'([0-9]+).([0-9]+)', r'stages.\1.blocks.\2', k)
out_dict[k] = v out_dict[k] = v
return out_dict return out_dict