diff --git a/timm/models/convmixer.py b/timm/models/convmixer.py index 55220bc084..854f84a07f 100644 --- a/timm/models/convmixer.py +++ b/timm/models/convmixer.py @@ -101,6 +101,9 @@ def forward(self, x): def _create_convmixer(variant, pretrained=False, **kwargs): + if kwargs.get('features_only', None): + raise RuntimeError('features_only not implemented for ConvMixer models.') + return build_model_with_cfg(ConvMixer, variant, pretrained, **kwargs) diff --git a/timm/models/efficientformer.py b/timm/models/efficientformer.py index 04204b3dd3..fe869d6654 100644 --- a/timm/models/efficientformer.py +++ b/timm/models/efficientformer.py @@ -534,6 +534,9 @@ def _cfg(url='', **kwargs): def _create_efficientformer(variant, pretrained=False, **kwargs): + if kwargs.get('features_only', None): + raise RuntimeError('features_only not implemented for EfficientFormer models.') + model = build_model_with_cfg( EfficientFormer, variant, pretrained, pretrained_filter_fn=_checkpoint_filter_fn, diff --git a/timm/models/mvitv2.py b/timm/models/mvitv2.py index bc18bbc2cd..692bf0eaee 100644 --- a/timm/models/mvitv2.py +++ b/timm/models/mvitv2.py @@ -948,6 +948,9 @@ def checkpoint_filter_fn(state_dict, model): def _create_mvitv2(variant, cfg_variant=None, pretrained=False, **kwargs): + if kwargs.get('features_only', None): + raise RuntimeError('features_only not implemented for Multiscale Vision Transformer models.') + return build_model_with_cfg( MultiScaleVit, variant, diff --git a/timm/models/xcit.py b/timm/models/xcit.py index a4cf9e46cb..7160c836ec 100644 --- a/timm/models/xcit.py +++ b/timm/models/xcit.py @@ -497,6 +497,9 @@ def checkpoint_filter_fn(state_dict, model): def _create_xcit(variant, pretrained=False, default_cfg=None, **kwargs): + if kwargs.get('features_only', None): + raise RuntimeError('features_only not implemented for Cross-Covariance Image Transformers models.') + model = build_model_with_cfg( Xcit, variant,