Open K1521 opened 1 day ago
Hi @K1521 -
Thanks for reporting this issue. Here While creating the model you can reuse the layer weight store in variable(t) t=layers.Dense(10)
instead of declaring new layer x = layers.Dense(10)(x)
.
Attached gist here for your reference.
if I create a model wich reuses layers I get a Error when trying to load it again.
I also found out how to fix it: https://github.com/keras-team/keras/blob/d3671cf276d838599dd8acec9616845ac262d52a/keras/src/models/functional.py#L687C3-L690C56
This ValueError has to be a IndexError (like in the legacy case in the code above).
That way it can be caught here: https://github.com/keras-team/keras/blob/d3671cf276d838599dd8acec9616845ac262d52a/keras/src/models/functional.py#L517C1-L525C36
:)