Once I fine-tune a model, I’d like to perform experiments with different heads but the same well-trained body.
To this end, I’d like to save just the body’s weights, and then instantiate a learner passing those weights like a pretrained model, while passing a head Kaimig-initialized.
How can I do it with fastai?
If you use
cnn_learner, the body is
learn.model. You can then use PyTorch load ans save functions to load/save it.
Great! I just ignored one could separately save chunks of the model (at least, not so easily)
What about for
TabularModel doesn’t seem to support indexing. Is there a way around this?