I found a forum post with a very similar problem to mine:
Technically, someone does give a solution and it does appear to work, however I suspect it may not be the recommended solution for this particular problem (at least I hope not).
In my specific scenario I am training a resnet model using cnn_learner starting with the pretrained weights, however my dataset is ultrasound images. Even though the pretrained model is a good starting point for training, as you can imagine my final model takes a significant amount of training time to get to the best accuracy. So what I would like to do is save that model somewhere and use it like it was a pretrained resnet model I started with again using cnn_learner. Is there any way to save this model and use it as if it were any other built in pretrained model?
It appears that if some linear layers on the head happen to have the same shape as before then those values will be copied over as well. How would you go about resetting the head even if it happened to have the same shape?
For now, I just enumerated the items and stopped copying when the head is reached, but that isn’t a good solution in general obviously.