-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
return of compute_output_shape
#19259
Comments
Option 2 seems to return a Tuple of tuples instead of single value. So not sure if they are equivalent. Also, the code references, you pointed to for |
What I meant is their type (tuple). Regardless any approaches, option 2 used to work with keras 2. Now, in keras 3, I faced an issue with this approaches, specifically on # with tensorflow
if dtype not in ALLOWED_DTYPES:
> raise ValueError(f"Invalid dtype: {dtype}")
E ValueError: Exception encountered when calling VideoSwinBasicLayer.call().
E
E Invalid dtype: <property object at 0x7fe799453e00>
E
E Arguments received by VideoSwinBasicLayer.call():
E • args=('<KerasTensor shape=(None, 4, 56, 56, 96), dtype=float32, sparse=False, name=keras_tensor_14086>',)
E • kwargs=<class 'inspect._empty'> # with jax
if dtype not in ALLOWED_DTYPES:
> raise ValueError(f"Invalid dtype: {dtype}")
E ValueError: Exception encountered when calling VideoSwinBasicLayer.call().
E
E Invalid dtype: ArrayImpl
E
E Arguments received by VideoSwinBasicLayer.call():
E • args=('<KerasTensor shape=(None, 4, 56, 56, 96), dtype=float32, sparse=False, name=keras_tensor_14075>',)
E • kwargs=<class 'inspect._empty'> To address it, returning the ouput shape info wrapping around
You're right, my bad. I should double check. |
The
compute_output_shape
return is changed. Following sample code, works in Keras 2 but breaks in Keras 3. The thing is, in the following code, as stated there, what are the difference of those returns.Also, In some official layers, for example multi-head-layer, or conv3d layer, and also from docstring, the
tf.TensorShape
is used incompute_output_shape
func. But doesn't it bring requirement to have tensorflow for other backends or any equivalentkeras.ops
?The text was updated successfully, but these errors were encountered: