Model saving in Avalanche #1068
Answered
by
AndreaCossu
AdityaJainTD
asked this question in
Q&A
-
Hi, I was wondering, how do we save the model in Avalanche? Is it same as saving torch model? An example would be great. |
Beta Was this translation helpful? Give feedback.
Answered by
AndreaCossu
Jun 16, 2022
Replies: 1 comment
-
Yes, you can save/load the model as you would normally do in PyTorch ( 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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AdityaJainTD
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 likeafter_training_iteration
. Otherwise you can save the model in your main, like: