-
Notifications
You must be signed in to change notification settings - Fork 26
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
There were problems saving and loading the model #12
Comments
Hi, thanks a lot for pointing out, there were indeed a serialization issue in keras_efficient_kan package that occurs when using layer normalization, which were the case in the TKAN, but not with other models that used it ! |
Thank you! |
The problem has not been completely solved. When I try to load the model in another file in the same environment, the problem still occurs. How do we fix this? Thank you. |
The save and load steps are the same as above. I have updated TKAN and keras_efficient_kan to the latest version. The error message is |
ValueError: A total of 2 objects could not be loaded. Example error message for object :The shape of the target variable and the shape of the target value in |
Hi, I have the same problem. It shows something like: List of objects that could not be loaded: |
I first saved the model using model.save, with no errors. But when I used
from keras.models import load_model model = load_model('my_model.keras')
to load the model, I get an error of
ValueError: A total of 4 objects could not be loaded. Example error message for object <KANLinear name=kan_linear, built=True>: The shape of the target variable and the shape of the target value in
variable.assign(value)must match. variable.shape=(1, 10), Received: value.shape=(1, 10). Target variable: <KerasVariable shape=(1, 3, 10), dtype=float32, path=tkan/tkan_cell/kan_linear/grid> List of objects that could not be loaded: [<KANLinear name=kan_linear, built=True>, <LayerNormalization name=layer_normalization, built=False>, <KANLinear name=kan_linear_1, built=True>, <LayerNormalization name=layer_normalization_1, built=False>]
There was no such error when I saved and loaded the LSTM model. How can I solve this?
The text was updated successfully, but these errors were encountered: