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
1.86k stars 297 forks source link

getting issues while saving model #54

Open SigireddyBalasai opened 10 months ago

SigireddyBalasai commented 10 months 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 10 months ago

@mlech26l @raminmh

mlech26l commented 10 months 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/