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

Normalization layer fails to broadcast scalar mean and variance #20624

Closed
boweia opened this issue Dec 10, 2024 · 0 comments · Fixed by #20626
Closed

Normalization layer fails to broadcast scalar mean and variance #20624

boweia opened this issue Dec 10, 2024 · 0 comments · Fixed by #20626
Assignees

Comments

@boweia
Copy link

boweia commented Dec 10, 2024

Normalization layer errors out for scalar mean and variance arguments. The documentation states that these arguments will be broadcast to the necessary size and the examples include scalars, but instead the source code seems to only reshape them (see here).

I'm using Python 3.12.1 and Keras 3.6.0.

>>> in1 = keras.Input(shape=(16, 16, 3))
>>> normLayer = keras.layers.Normalization(mean=0.1, variance=0.05)
>>> out1 = normLayer(in1)
I tensorflow/core/framework/local_rendezvous.cc:405] Local rendezvous is aborting with status: INVALID_ARGUMENT: Input to reshape is a tensor with 1 values, but the requested shape has 3
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 a pull request may close this issue.

2 participants