Retrain the saved model

I made a multi class image classification model which does the identification of images into three catgegories. It worked great.
Now I have more similar data, but has 4 labels. I was wondering if I could use the above model( its weights) to retrain it for 4 labels. Does it sound good? If yes, how would I do that. I can certainly load the model like, but after that I am clueless.

sz=224
arch=resnet50
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=False)
learn.load(“three_class_aug_no_16th_Slice_besT_model”)

1 Like

I think I found it. I used following for reference:

Though, instead of
learn.model[-1][-1]=nn.Linear(in_features=512,out_features=5, bias=True)

I did learn.model[-2] = nn.Linear(in_features=512,out_features=5, bias=True), as for me the last layer was softmax

Though, I dont see any improvement. In fact I see either same level of performace or slightly worse. Is it due to less number of training data? The images are very similar though.