Restore the best model
What would be the most lightning way to restore the best model? Either directly after training (in the same script) or for later use (in another script)?
Thanks in advance !
You can use the checkpont callback to save the only the best model as described here: https://williamfalcon.github.io/pytorch-lightning/Trainer/Checkpointing/ (note that that doc needs to be updated. Use save_top_k=1 instead of save_best_only)
You can then use the load_from_checkpoint method to restore your checkpoint: https://williamfalcon.github.io/pytorch-lightning/LightningModule/methods/#load_from_metrics