You can actually do this using nn.Sequential quite easily. Have a look at my notebook: https://github.com/TheShadow29/FAI-notes/blob/master/notebooks/Using-Pretrained-Pytorch-Models.ipynb.
Specifically, get the pretrained model using md = learn.model
. Print the model, keep the model till before the max pool. After that add a custom head. Suppose the max pool is at layer -5, you can do new_md = nn.Sequential(*list(children(md))[:-5], custom_head)
. custom head basically includes everything you would need after the max pool. once you have the new model you can create a new learner using learn_new = ConvLearner.from_model_data(new_md, data)
.
Hope this helps