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

[Bug] keras Add layer failing to build #19810

Closed
qzhang-nuro opened this issue Jun 5, 2024 · 0 comments
Closed

[Bug] keras Add layer failing to build #19810

qzhang-nuro opened this issue Jun 5, 2024 · 0 comments
Assignees

Comments

@qzhang-nuro
Copy link

qzhang-nuro commented Jun 5, 2024

Keras Version: 3.3.3

Example code:

import keras
add_layer = keras.layers.Add()
symbolic_a = keras.layers.Input(shape=(32,))
symbolic_b = keras.layers.Input(shape=(32,))
add_layer([symbolic_a, symbolic_b])

Error trace:

  File "...keras/keras/src/layers/merging/base_merge.py", line 65, in build
    if not isinstance(input_shape[0], (tuple, list)):
TypeError: 'NoneType' object is not subscriptable

Possible root cause:
layer input is a list. is_nested does not return True for a list therefore the Callspec tensor_arg_dict is empty, and add's build gets a None as its input_shape argument

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

No branches or pull requests

2 participants