How to save best model/ model checkpoints during training?

@aakashns Could you tell how to save best model/ model checkpoints during training in this leacture?

You’ll need to modify the fit function, Just keep track of the best loss/accuracy and if you notice an improvement after a particular epoch, save the model using torch.save(model.state_dict(), 'best-weights.pth')

Courtesy- @aakashns

1 Like