Is there a built-in callback that can automaticall...
# neural-forecast
b
Is there a built-in callback that can automatically save the best-performing model checkpoints during long training runs? Looking for something like ModelCheckpoint in tensorflow
j
from examining the model code, you can pass in trainer_kwargs when creating a model object, eg:
Copy code
NHIST(..., enable_checkpointing: True, callbacks=[ModelCheckpoint(...)])
https://lightning.ai/docs/pytorch/stable/api/pytorch_lightning.trainer.trainer.Trainer.html You can then pass in a lightning.pytoch.callbacks.ModelCheckpoint https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.ModelCheckpoint.html
b
That'll do it, thank you!