ibm-granite / granite-tsfm

Foundation Models for Time Series
Apache License 2.0
419 stars 184 forks source link

Loading model trained from scartch #121

Open rdabc opened 2 months ago

rdabc commented 2 months ago

Hi,

I am training a model from scratch using 'patch_tst_getting_started.ipynb' notebook. It seems that the model is saving checkpoints in "./checkpoint/patchtst/direct/train/output/" . How can I load the final model? I assume that the best model in terms of validation loss is saved in "./checkpoint/patchtst/direct/train/output/" ? In my case, three checkpoint repos are created : "checkpoint-2597000", "checkpoint-2623500" and "checkpoint-2650000". How these checkpoints are selected?

Thank you, Best regards

wgifford commented 1 week ago

Once training has completed, you can run:

trainer.save_model("new_model_path")

Then, later you can use .from_pretrained, e.g. PatchTSTForPrediction.from_pretrained(new_model_path).