-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Invalid reduction dimension (2 for input with 2 dimension(s) [Op:Sum] #20221
Comments
Hi @MilkFiish, I looked into your issue and found out that the error is due to a mismatch between the dimensionality of the input tensor and the axis specified in the UnitNormalization layer. You should use np.random.rand(2, 3, 1) instead |
If there is an input error, I thought it should have an error report for both static and dynamic execution, which is why I bring up the issue. |
You're correct. I have created a Pull Request regarding the same by adding validation checks #20237 |
* added validation checks and raised error if an invalid input shape is passed to compute_output_shape func in UnitNormalization Layer * updated my change to check if the input is int or an iterable before iterating * Update unit_normalization.py --------- Co-authored-by: François Chollet <francois.chollet@gmail.com>
@MilkFiish , Now with the validation check in the above linked PR, it is throwing the proper error as |
This error occurs when I do dynamic execution work with
keras.layers.UnitNormalization
, but not when I do static inference.The code below is executed in the tensorflow backend environment.
When I print result_static, it's [2, 3]. However, the dynamic part causes the error
By traceback information, it seems that an illegal input has been sent to the backend, and an input check may need to be added.
The text was updated successfully, but these errors were encountered: