-
Notifications
You must be signed in to change notification settings - Fork 430
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
Convert all non-RGB
images to RGB
in CLIPImageTransform
#1975
Comments
Thanks for creating the issue. Actually this was done as a bit of a one-off so we probably can consider changing to match the eval recipe. cc @pbontrager in case you have any strong objections to this, but otherwise @vancoykendall we'd love to have you open a PR with the change if you're interested. |
@ebsmothers sounds good. Also, I think like the eval code I can remove the check for the |
@ebsmothers Just created a pr #1976 |
Closing now that the fix has landed. Thanks again! |
In the
CLIPImageTransfrom
, onlyRGBA
images get converted toRGB
. I don't see a reason to not convert all non-RGB
images. I have a multimodal dataset with mostlyRGB
images, but a handful are inCMYK
andL
. I'm finetuning a Llama3.2 VLM which uses theCLIPImageTransform
and my first training crashed in the middle because aCMYK
image finally was loaded, didn't get converted, and the size didn't match.torchtune/torchtune/models/clip/_transform.py
Lines 161 to 163 in 96dea61
I noticed the code in the eval recipe actually does convert all non-
RGB
images toRGB
:torchtune/recipes/eleuther_eval.py
Lines 168 to 170 in 96dea61
The text was updated successfully, but these errors were encountered: