recommenders icon indicating copy to clipboard operation
recommenders copied to clipboard

[ASK] How can I save SASRec model for re-training and prediction?

Open beomso0 opened this issue 2 years ago • 2 comments

I have tried to save trained SASRec model.

pickle, tf.saved_model.save, model.save(), and surprise.dump are not working.

While saving, I got warning saying 'Found untraced functions', and while loading, 'AttributeError: 'SASREC' object has no attribute 'seq_max_len''.

Plz someone let me know how to save and load SASRec model!

beomso0 avatar May 13 '22 18:05 beomso0

Hey @beomso0 , If you want save model in TensorFlow. I have shared one link below. that's might be help you. https://cv-tricks.com/tensorflow-tutorial/save-restore-tensorflow-models-quick-complete-tutorial/ please go through this.

RanjanRavi2398 avatar Dec 06 '22 09:12 RanjanRavi2398

Hey @beomso0 , If you want save model in TensorFlow. I have shared one link below. that's might be help you. https://cv-tricks.com/tensorflow-tutorial/save-restore-tensorflow-models-quick-complete-tutorial/ please go through this.

Blindly applying this solution causes bunch of other errors due to the tf v2 compatibility issue. Creating a Saver is impossible when the eager_execution is turned on; when it is turned off, the training won't happen. It would be greatly appreciated if save function is implemented for SASRec.

YoungWoong-Cho avatar Aug 30 '23 14:08 YoungWoong-Cho