-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update warning for image processor loading #28209
Conversation
cc @NielsRogge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving this! Will avoid the confusion here: https://discuss.huggingface.co/t/error-finding-processors-image-class-loading-based-on-pattern-matching-with-feature-extractor/31890
Thanks for opening this @ydshieh! As mentioned in the internal slack channel - I'd rather we had a transition with this: at least two releases instructing the users how to update before downgrading the warnings. Unlike the text_config for CLIP, loading feature extractors for vision is deprecated and it's necessary for users to change their configs to ensure future compatibility. |
Thanks @amyeroberts Sound fair. Do you want me to change the warning to include the instructions and the version number involved (i.e. 2 release after since the current one)? |
@amyeroberts I'm not sure it's doable to expect users to update their config? That would upset a lot of users. We have 8000+ So my suggestion would be to gracefully handle this internally in the |
@ydshieh Yes please!
@NielsRogge Certainly not! :) This is why we will downgrade the warning after a cycle. However, we should give users the opportunity to correctly update their configs as necessary by giving them the necessary information as they will not be supported in the future. |
77e9e81
to
2c5fff7
Compare
"Could not find image processor class in the image processor config or the model config. " | ||
f"If you are the owner of {pretrained_model_name_or_path}, please update the file " | ||
"`preprocessor_config.json` to use `image_processor_type` instead of `feature_extractor_type`. " | ||
"Otherwise, you can open a pull request on this Hub repository. " | ||
"This warning will be removed in v4.40. Currently, we try to load the image processor based on " | ||
"pattern matching with the model's feature extractor configuration." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amyeroberts let me know if this is too wordy 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put v4.40 to give it a bit more time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding @ydshieh!
Just a suggestion on the warning. Could you update the PR title before merging?
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
logger.info
for image processor loading
I have to change a bit of the warning message - if you would like to take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating!
What does this PR do?
Similar to #28108, there is not much we/user can do with the files on the Hub.
For this image processor loading, IMO, the attribute
image_processor_class
/feature_extractor_class
are super unlikely specified by users (they are created automatically during saving for auto class to work). Sologger.info
is fine.