In my particular scenario, I want torch.save() to append the model state rather than overwrite it whenever it is called.
Assume I have a pre-trained cGAN model on 0 to 5 mnist dataset classes with classes as conditions (saved using torch.save() with the filename “trained.pt”).
Now I want to fine-tune this pre-trained model so that it can learn the remaining 6 to 9 classes. I saved the model in the same “trained.pt” file but noticed that it was overwriting the model state, i.e. it can generate images with 6-9 digits but ignores the 0-5 classes which were learned by the pre-trained model.
I tried to search but couldn’t come up with a solution so far. Is there a way so that I can append my finetuned model in the pre-trained model.