In the code you’ve posted you just created an instance of DropoutFC without using it.
I’m not sure, how you are using the module.
If you want to add a dropout and linear layer to your pre-trained model, you could use:
model = models.resnet50(pretrained=True)
model.fc = nn.Sequential(
    nn.Dropout(p=0.5)
    nn.Linear(2048, number_classes)
)