How to tranfer weight of trained model and map on which have fewer classes?

Hello, I am working on a classification and detection task where my old model was trained on 14 classes used a pre-train densenet 121. Now I have a new dataset with 10 classes and want to train that trained model.
My model is like below:

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")


# device = torch.device("cpu")
model = rps.models.get_classifier(models.densenet121, 14).to(device) 
# I want to train the model on 10 classes where when I try to mentioned 10 it get error due to `state_dic`.
model.load_state_dict(torch.load('/home/ali/models/classifier_densenet121.pth')

Note: rps is my module name and the model is a combination of FPN + DenseNet121. I load the model using this:
But I don’t know how to extract the 10 classes weights from the state_dict?

I had been searching these links too.

Please Help me put
Thank you very much

Answer:
After a few try-and-hit methods I find a solution that is very simple to map the weights of the state_dic.
Which is in the form of strict=False.

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")


# device = torch.device("cpu")
model = rps.models.get_classifier(models.densenet121, 14).to(device) 
# I want to train the model on 10 classes where when I try to mentioned 10 it get error due to `state_dic`.
model.load_state_dict(torch.load('/home/ali/models/classifier_densenet121.pth'), , strict=False )

Thanks