pradpalnis:

Single Images has to be classified with two labels.


Does it mean you are working with 10 labels and for each sample two of these labels are active?
If so, your code looks fine:
in_features = resnet.fc.in_features
resnet.fc = nn.Linear(in_features, 10 )

Just make sure the target has the same shape as the model’s output ([batch_size, 10]) and contains the corresponding labels (1. for the active classes, 0 else).
PS: If you are not applying a sigmoid on the output, use nn.BCEWithLogitsLoss.