Skip to content
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

Fix dtype bug in image converter #2147

Merged
merged 3 commits into from
Mar 17, 2025

Conversation

abheesht17
Copy link
Collaborator

@abheesht17 abheesht17 commented Mar 17, 2025

When we pass bfloat16 as the dtype in image converter and call it, it fails. Here's a Colab to demonstrate this.

Still curious why our preset tests for PaliGemma don't fail on GH Actions. Edit: Oh, it is because we don't run "large" tests: https://github.com/keras-team/keras-hub/blob/master/.github/workflows/actions.yml#L63.

@github-actions github-actions bot added the Gemma Gemma model specific issues label Mar 17, 2025
@abheesht17
Copy link
Collaborator Author

abheesht17 commented Mar 17, 2025

Question though: is it okay to do image preprocessing in bfloat16?

@abheesht17 abheesht17 removed the Gemma Gemma model specific issues label Mar 17, 2025
else:
return np.expand_dims(value, broadcast_dims)
return np.expand_dims(value, broadcast_dims).astype(inputs.dtype)
Copy link
Member

Choose a reason for hiding this comment

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

You might to call standardize dtype here, looks like tf dtypes are causing issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's weird that the tests are not failing locally

@abheesht17 abheesht17 requested a review from mattdangerw March 17, 2025 17:03
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

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

Thanks!

@abheesht17 abheesht17 merged commit e9241dd into keras-team:master Mar 17, 2025
7 checks passed
mattdangerw added a commit to mattdangerw/keras-hub that referenced this pull request Mar 30, 2025
mattdangerw added a commit to mattdangerw/keras-hub that referenced this pull request Mar 30, 2025
mattdangerw added a commit to mattdangerw/keras-hub that referenced this pull request Apr 1, 2025
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.

2 participants