Skip to content

Model saving in Avalanche #1068

Answered by AndreaCossu
AdityaJainTD asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can save/load the model as you would normally do in PyTorch (torch.save()). If you want to do that within the strategy you can sub-class it and override a specific callback like after_training_iteration. Otherwise you can save the model in your main, like:

for exp in benchmark.train_stream:
    strategy.train(exp)
    strategy.eval(benchmark.test_stream)
    # here you can save your model. You can also access it by strategy.model property
    # in this way, you have a checkpoint after each training experience

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AdityaJainTD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants