CenterCrop meets a division-by-zero with jax backend
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:
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.
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!
Hi, The issue has been fixed and I can see the proper output in the keras-nighlty version, attaching the Gist here for reference
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.