mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Disable strict load when siglip vit pooling removed
This commit is contained in:
parent
963d80b299
commit
d3ebdcfd93
@ -1603,11 +1603,17 @@ def _create_vision_transformer(variant, pretrained=False, **kwargs):
|
|||||||
else:
|
else:
|
||||||
_filter_fn = checkpoint_filter_fn
|
_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(
|
return build_model_with_cfg(
|
||||||
VisionTransformer,
|
VisionTransformer,
|
||||||
variant,
|
variant,
|
||||||
pretrained,
|
pretrained,
|
||||||
pretrained_filter_fn=_filter_fn,
|
pretrained_filter_fn=_filter_fn,
|
||||||
|
pretrained_strict=strict,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user