-
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
The problem has not been completely solved. #15
Comments
Hi, I have the same problem. It shows something like: List of objects that could not be loaded: |
Hi ! Back from holidays only now, sorry for the delay ! |
Hi, I think the problem hasn't been resolved completely. I continue to get the problem with: config={'module': 'tKanModel', 'class_name': 'vaeTKAN', 'config': {'name': 'vae_tkan', 'trainable': True, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}}, 'registered_name': 'vaeTKAN', 'compile_config': {'optimizer': {'module': 'keras.optimizers', 'class_name': 'Adam', 'config': {'name': 'adam', 'learning_rate': 0.0010000000474974513, 'weight_decay': None, 'clipnorm': None, 'global_clipnorm': None, 'clipvalue': None, 'use_ema': False, 'ema_momentum': 0.99, 'ema_overwrite_frequency': None, 'loss_scale_factor': None, 'gradient_accumulation_steps': None, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False}, 'registered_name': None}, 'loss': None, 'loss_weights': None, 'metrics': None, 'weighted_metrics': None, 'run_eagerly': False, 'steps_per_execution': 1, 'jit_compile': True}}. Exception encountered: Unable to revive model from config. When overriding the Received config={'name': 'vae_tkan', 'trainable': True, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}} Error encountered during deserialization: 'NoneType' object is not subscriptable", File ~/Documents/2ndrealdatajournalchile/tKanModel.py:31, in vaeTKAN.init(self, config, **kwargs) TypeError: 'NoneType' object is not subscriptable During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/models/model.py:540, in Model.from_config(cls, config, custom_objects) TypeError: Unable to revive model from config. When overriding the Received config={'name': 'vae_tkan', 'trainable': True, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}} Error encountered during deserialization: 'NoneType' object is not subscriptable During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/saving/saving_api.py:189, in load_model(filepath, custom_objects, compile, safe_mode) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/saving/saving_lib.py:365, in load_model(filepath, custom_objects, compile, safe_mode) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/saving/saving_lib.py:442, in _load_model_from_fileobj(fileobj, custom_objects, compile, safe_mode) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/saving/saving_lib.py:431, in _model_from_config(config_json, custom_objects, compile, safe_mode) File ~/anaconda3/envs/tensorflowNewest/lib/python3.12/site-packages/keras/src/saving/serialization_lib.py:720, in deserialize_keras_object(config, custom_objects, safe_mode, **kwargs) TypeError: <class 'tKanModel.vaeTKAN'> could not be deserialized properly. Please ensure that components that are Python object instances (layers, models, etc.) returned by config={'module': 'tKanModel', 'class_name': 'vaeTKAN', 'config': {'name': 'vae_tkan', 'trainable': True, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}}, 'registered_name': 'vaeTKAN', 'compile_config': {'optimizer': {'module': 'keras.optimizers', 'class_name': 'Adam', 'config': {'name': 'adam', 'learning_rate': 0.0010000000474974513, 'weight_decay': None, 'clipnorm': None, 'global_clipnorm': None, 'clipvalue': None, 'use_ema': False, 'ema_momentum': 0.99, 'ema_overwrite_frequency': None, 'loss_scale_factor': None, 'gradient_accumulation_steps': None, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False}, 'registered_name': None}, 'loss': None, 'loss_weights': None, 'metrics': None, 'weighted_metrics': None, 'run_eagerly': False, 'steps_per_execution': 1, 'jit_compile': True}}. Exception encountered: Unable to revive model from config. When overriding the Received config={'name': 'vae_tkan', 'trainable': True, 'dtype': {'module': 'keras', 'class_name': 'DTypePolicy', 'config': {'name': 'float32'}, 'registered_name': None}} Error encountered during deserialization: 'NoneType' object is not subscriptable" |
Could you give a code to reproduce as well as packages versions ? |
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
variable.assign(value)
must match. variable.shape=(1, 10), Received: value.shape=(1, 10). Target variable: <KerasVariable shape=(1, 65, 10), dtype=float32, path=tkan/tkan_cell/kan_linear/grid>List of objects that could not be loaded:
[<KANLinear name=kan_linear, built=True>, <KANLinear name=kan_linear_1, built=True>]
Originally posted by @ChineseDictionary in #12 (comment)
The text was updated successfully, but these errors were encountered: