I am using resnet34 as my base model, with last few layers as linear layer followed by sigmoid. My code looks like:
temp = nn.Sequential(
          nn.Dropout(p=0.5),
          nn.Linear(in_features=512, out_features=128),
          nn.ReLU(),
          nn.Linear(in_features=128, out_features=17, bias=True),
          nn.Sigmoid()
        )

classifier = torchvision.models.resnet34(pretrained=True)
classifier.fc = temp  

I am using Adam optimizer with BCELoss.
And for every epoch I am just calling the above function

train_classifier(classifier, )