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

CenterCrop meets a division-by-zero with jax backend #19723

Open
AGFACBNNR opened this issue May 17, 2024 · 2 comments
Open

CenterCrop meets a division-by-zero with jax backend #19723

AGFACBNNR opened this issue May 17, 2024 · 2 comments
Assignees
Labels
backend:jax stat:contributions welcome A pull request to fix this issue would be welcome. type:Bug

Comments

@AGFACBNNR
Copy link

As shown in this colab, I have an image of size (11,3). Using CenterCrop I can resize it to (7,17) and (5,4), but I meet a crash when trying to resize it to (5,17).
According to the error message, it seems that Keras generates an scaled image of height 0 and passes it to backends.
I've tried to change the backend and the same problem also shows up with tensorflow and torch backend.
The only difference is that tensorflow and torch checks the existence of 0, while jax directly uses it as a divisor.
Currently the output is:
1715918255039

@mehtamansi29
Copy link
Collaborator

Hi @AGFACBNNR

Thanks for reporting the issue. I have tested the code snippet and reproduces the reported behaviour. Attached gist file for reference.

We will look into the issue and update you the same.

@chunduriv chunduriv added the keras-team-review-pending Pending review by a Keras team member. label May 22, 2024
@mattdangerw mattdangerw added stat:contributions welcome A pull request to fix this issue would be welcome. and removed keras-team-review-pending Pending review by a Keras team member. labels May 23, 2024
@mattdangerw
Copy link
Member

Just running you colab, I actually see a failure on all backends, jax/tf/torch. So this might just be a general bug.

Either way, open for contributions if someone want to take this on. I'll take a look later too to see if its an easy fix.

Thanks for filing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:jax stat:contributions welcome A pull request to fix this issue would be welcome. type:Bug
Projects
None yet
Development

No branches or pull requests

6 participants