mlech26l / ncps

PyTorch and TensorFlow implementation of NCP, LTC, and CfC wired neural models
https://www.nature.com/articles/s42256-020-00237-3
Apache License 2.0
2.03k stars 320 forks source link

getting issues while saving model #54

Open SigireddyBalasai opened 1 year ago

SigireddyBalasai commented 1 year ago

----> 1 model.save('location.keras')

File /opt/conda/lib/python3.10/site-packages/keras/utils/traceback_utils.py:70, in filter_traceback..error_handler(*args, **kwargs) 67 filtered_tb = _process_traceback_frames(e.traceback) 68 # To get the full stack trace, call: 69 # tf.debugging.disable_traceback_filtering() ---> 70 raise e.with_traceback(filtered_tb) from None 71 finally: 72 del filtered_tb

File /opt/conda/lib/python3.10/site-packages/ncps/tf/wired_cfc_cell.py:122, in WiredCfCCell.get_config(self) 120 seralized["mode"] = self.mode 121 seralized["activation"] = self._activation --> 122 seralized["backbone_units"] = self.hidden_units 123 seralized["backbone_layers"] = self.hidden_layers 124 seralized["backbone_dropout"] = self.hidden_dropout

AttributeError: 'WiredCfCCell' object has no attribute 'hidden_units'

SigireddyBalasai commented 1 year ago

@mlech26l @raminmh

mlech26l commented 1 year ago

Hi @SigireddyBalasai

Model saving is not supported. You need to save/load only the weights: https://keras.io/api/saving/weights_saving_and_loading/

waqas-phc commented 18 hours ago

I just have to ask Do we have to save the wiring as well in order to save the complete model data during training checkpoint.

What will be the difference between loading models weights only and model weights + wiring.