-
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
Can't load model with tf v2.14 if the model was saved with previous tf versions #18830
Comments
Great, thanks, waiting to hear the conclusion on whether it is solvable or by-design. |
This is a known issue that affects certain models across the version boundary. It is already fixed but of course the fix isn't part of old TF 2.13. What I would suggest is to use |
Hi @fchollet, thank you for the explanation. Just want to understand the current status - so when you say that this bug "is already fixed", to what tf version are you referring? Because I'm still unable to save a model in tf 2.15 and load it with the nightly version. |
Hello,
I have a model that I saved using tf 2.13 version.
When trying to load it using tf 2.14 (or 2.15) I'm getting the following error:
Some additional information:
This is a simple model that only contains two similar Conv2d layers.
The issue doesn't occur when there aren't at least two similar layers of the same type.
The issue also happens when saving the model with tf version smaller than 2.13 (and loading with 2.14).
Code to reproduce:
`
Run with TF 2.13:
import tensorflow as tf
_in = tf.keras.layers.Input(shape=(8, 8, 3))
x = _in
x = tf.keras.layers.Conv2D(3, 3)(x)
x = tf.keras.layers.Conv2D(3, 3)(x)
_out = x
model = tf.keras.Model(inputs=_in, outputs=_out)
model.save('model_213.keras')
Run with TF 2.14:
loaded_model = tf.keras.models.load_model('model_213.keras')
`
I opened a similar issue in the TF repository, but it seems that this issue is more Keras-related.
Appreciate your support.
The text was updated successfully, but these errors were encountered: