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
cannot load fine-tuned model #19518
Comments
Hi @lwind18 , For me it seems the issue is with version mismatch. Could you please provide more details like on which Keras version earlier model was trained and which version you are trying to reload? Right now Keras3 designed to support multiple backends there might be design changes. |
The model trained with keras 2.6 an also tensorflow 2.6. Then I tried load this model under keras 2.6 and tensorflow 2.6, and I tried 2.8, 2.9, 2.10, 2.11 and they ended with the same error. |
If you have trained and loading the model in same version then it should load without any error. If there are versions mismatches wrt training and reloading the model then such problem may arise. Please double check your environment details while reloading the model its pointing to correct version of TF/Keras that the model trained. Please submit a minimal code snippet for reproduction. |
I used the newer tensorflow version (higher than v2.11) to train the model and load it. It gave me the same error. |
I train the model from a scratch and name it as modelA. Then use the new training data to train this trained model (modelA). The training process looks good. Then when I load the model using tf.keras.models.load_model, I ran into this issue:
TypeError: Layer input_spec must be an instance of InputSpec. Got: <keras.initializers.initializers_v2.GlorotUniform object at 0x7f6c285f0130>
Does anyone can help me out with this issue? Where is wrong with this fine-tuned model? I remembered that I didn't use GlorotUniform when I built the model.
Thanks!
The text was updated successfully, but these errors were encountered: