Skip to content

Commit d3ebdcf

Browse files
committed
Disable strict load when siglip vit pooling removed
1 parent 963d80b commit d3ebdcf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

timm/models/vision_transformer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,11 +1603,17 @@ def _create_vision_transformer(variant, pretrained=False, **kwargs):
16031603
else:
16041604
_filter_fn = checkpoint_filter_fn
16051605

1606+
# FIXME attn pool (currently only in siglip) params removed if pool disabled, is there a better soln?
1607+
strict = True
1608+
if 'siglip' in variant and kwargs.get('global_pool', None) != 'map':
1609+
strict = False
1610+
16061611
return build_model_with_cfg(
16071612
VisionTransformer,
16081613
variant,
16091614
pretrained,
16101615
pretrained_filter_fn=_filter_fn,
1616+
pretrained_strict=strict,
16111617
**kwargs,
16121618
)
16131619

0 commit comments

Comments
 (0)