We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ecf45d commit 5fc7c5cCopy full SHA for 5fc7c5c
tools/model_converters/beit2mmseg.py
@@ -12,9 +12,6 @@ def convert_beit(ckpt):
12
new_ckpt = OrderedDict()
13
14
for k, v in ckpt.items():
15
- if k.startswith('patch_embed'):
16
- new_key = k.replace('patch_embed.proj', 'patch_embed.projection')
17
- new_ckpt[new_key] = v
18
if k.startswith('blocks'):
19
new_key = k.replace('blocks', 'layers')
20
if 'norm' in new_key:
@@ -24,6 +21,9 @@ def convert_beit(ckpt):
24
21
elif 'mlp.fc2' in new_key:
25
22
new_key = new_key.replace('mlp.fc2', 'ffn.layers.1')
26
23
new_ckpt[new_key] = v
+ elif k.startswith('patch_embed'):
+ new_key = k.replace('patch_embed.proj', 'patch_embed.projection')
+ new_ckpt[new_key] = v
27
else:
28
new_key = k
29
0 commit comments