Hi everyone, thanks for reporting about this.
The message:
Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration.
is being shown, because the image processor to load is being inferred from a config which specifies a feature extractor. Feature extractors are now deprecated for vision models. For example, this swin configuration specifies ViTFeatureExtractor
. The warning is there as there isn’t a guarantee the correct image processor class will be loaded.
The inference of the image processor from the feature extractor name is done, as this allows for a smooth deprecation cycle of the feature extractors, where older configs can be used without breaking changes.
We realise that the warning message can be both concerning and overly aggressive. Its visibility was in part to make explicit the deprecation and encourage the update of custom checkpoint configurations. We’re trying to find the right balance between warning now loudly vs. more silent but possibly unexpected behaviour later. For many public configs it’s not something an individual user would be able to update at the moment, and so downgrading to logger.info
might be a suitable option. Please do share if you have alternative suggestions e.g. alternative warning message to make it clearer.