Are you getting a return value of Nones now?
I’m unsure about your initial use case, as torchvision.models.detection.fasterrcnn_resnet50_fpn doesn’t seem to contain any dropout layers and uses FrozenBatchNorm layers. Which layers would you like to set to eval mode specifically?
At least this code snippet doesn’t find any dropout layers:
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
model.train()
for name, m in model.named_modules():
    if isinstance(m, nn.Dropout):
        print('setting {} to eval()'.format(name))
        m.eval()