Skip to content

Commit

Permalink
Disable strict load when siglip vit pooling removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed Oct 19, 2023
1 parent 963d80b commit d3ebdcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions timm/models/vision_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1603,11 +1603,17 @@ def _create_vision_transformer(variant, pretrained=False, **kwargs):
else:
_filter_fn = checkpoint_filter_fn

# FIXME attn pool (currently only in siglip) params removed if pool disabled, is there a better soln?
strict = True
if 'siglip' in variant and kwargs.get('global_pool', None) != 'map':
strict = False

return build_model_with_cfg(
VisionTransformer,
variant,
pretrained,
pretrained_filter_fn=_filter_fn,
pretrained_strict=strict,
**kwargs,
)

Expand Down

0 comments on commit d3ebdcf

Please sign in to comment.