You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I know that it works if you feed the layer in itself, but that is not what i want to do. I have reduced a larger example down to this example.
As i have said , i have solved the problem by replacing the ValueError with a IndexError. That way the code is more similar to the legacy case here:
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
:)
The text was updated successfully, but these errors were encountered: