Skip to content

Revert "Fix dtype bug in image converter (#2147)" #2180

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

Merged
merged 2 commits into from
Apr 3, 2025

Conversation

mattdangerw
Copy link
Member

This reverts commit e9241dd.

@abheesht17 reverting this because one of the main modes of operation is taking a uint8 image -> rescaled float output. Basically keras_hub.layers.ImageConverter(scale=1./255)(int_image). Whit this change we would cast back to int and flatten the image into all 0s and 1s.

@mattdangerw mattdangerw requested a review from abheesht17 March 31, 2025 16:34
@abheesht17
Copy link
Collaborator

This reverts commit e9241dd.

@abheesht17 reverting this because one of the main modes of operation is taking a uint8 image -> rescaled float output. Basically keras_hub.layers.ImageConverter(scale=1./255)(int_image). Whit this change we would cast back to int and flatten the image into all 0s and 1s.

This will break PaliGemma though. At least, I was not able to run it on Colab (maybe, doing something wrong). Here's the notebook: https://colab.research.google.com/gist/abheesht17/c4eb5ecf392143ba8927c116954b8aa8/kerashub-image-converter-dtype-bug.ipynb. So, we should fix that?

@mattdangerw
Copy link
Member Author

Thanks! I'll take a look. Right now the basic image backbones (resnet, etc.) are broken, but let's find a way that works for everything.

@abheesht17
Copy link
Collaborator

Oh, and Gemma3 will break too

@mattdangerw
Copy link
Member Author

@abheesht17 I think this fixes things. Can you check?

@mattdangerw mattdangerw force-pushed the revert-2147 branch 6 times, most recently from 8b6f2d9 to 13c3295 Compare April 2, 2025 06:39
@mattdangerw mattdangerw added the kokoro:force-run Runs Tests on GPU label Apr 2, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Apr 2, 2025
@mattdangerw
Copy link
Member Author

Ugh this is whack-a-mole. Take two.

@mattdangerw mattdangerw force-pushed the revert-2147 branch 3 times, most recently from c2100a3 to 9cb9ab5 Compare April 2, 2025 07:38
@mattdangerw mattdangerw added the kokoro:force-run Runs Tests on GPU label Apr 2, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Apr 2, 2025
Copy link
Collaborator

@abheesht17 abheesht17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Working with Gemma3. Merging

@abheesht17 abheesht17 merged commit 87fca10 into keras-team:master Apr 3, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants