Transfer learning (cut off head)?

Hey all,

So I want to use transfer learning on my own dataset from a pulic dataset. I’m using unet_learner (image segmentation problem). However the public dataset only has 2 parameters for segmentation and my own has 4 parameters.
To get a better idea:
Public dataset parameters: background, object
Private dataset parameters: Imageborder, background, object1 , object2 (One can imagine the object from the public dset being furhter distinguished; public sees cat, private wants to see body and head of cat).
How do I load the pretrained model on the public dataset to adjust to my private dataset ?
The error I get with: learn.load(‘model_1’)
looks like this

Jeremy said in the lectures that one has to cut off the head but how do I do that since I cant even load the model.
Thanks in advance for any help.

cut off head is normally used from an image classification model (ex: resnet). I’m not sure if it exists for segmentation unet model :frowning:

1 Like

Hello, lemme see if I got your question correct. You have a pretrained model and you want to cut the encoder and train with a different head?

If the answer to your question above is yes, then it’s totally possible. You should just figure how to split your model into an encoder and pass in the encoder in Unet Learner.

Use the examples at the bottom of this as motivation

You see how the examples cuts the encoder of the pretrained resnet 34

Also I think that you mean classes instead of parameters.

Using parameters is really confusing to someone trying to help.