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

DropBlock2D not working with TensorFlow backend in graph mode on Keras 3 #2451

Open
Lescurel opened this issue May 30, 2024 · 1 comment
Open
Assignees
Labels

Comments

@Lescurel
Copy link

Lescurel commented May 30, 2024

Current Behavior:

On Keras 3 with TensorFlow 2.16.1, DropBlock2D fails on graph mode with the following casting error:

TypeError: Exception encountered when calling DropBlock2D.call().

int() argument must be a string, a bytes-like object or a real number, not 'SymbolicTensor'

Arguments received by DropBlock2D.call():
  • x=tf.Tensor(shape=(32, 8, 8, 8), dtype=float32)
  • training=True

Steps To Reproduce:

See the following collab:
DropBlock2D Graph Mode

Version:

keras_cv.__version__='0.9.0'
keras.__version__='3.0.0'
tf.__version__='2.16.1'

Anything Else:

The fix is trivial, just use ops.cast() instead of python int() in the call method of the Layer.

@mehtamansi29 mehtamansi29 self-assigned this May 31, 2024
@mehtamansi29 mehtamansi29 added the type:Bug Something isn't working label May 31, 2024
@mehtamansi29
Copy link
Collaborator

Hi @Lescurel -

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants