youre right. i think this might fix it.
once youre done training on the planet dataset:
learn.model[-1][-1]=nn.Linear(in_features=512,out_features=5, bias=True)
i think this should set the last linear layer (outputs) to the number of outputs for your data. i just plugged in the same number of in_features
that learn.model[-1][-1]
printed out and switched out_features
with the number of classes your dataset has.
then you can do learn.save(‘double-pretrain’), and you should be able to make a new learner with your dataset and resnet50, learn.load(‘double-pretrain’) and train