Hi,
Setting up the model appears to have worked seamlessly. I’m not sure about side effects, but I do hope I have set up defining the model and freezing the parameters correctly. Here is what appears to have not produced any errors:
resnet50 = models.resnet50(pretrained=True)
for param in resnet50.parameters():
    param.requires_grad = False
# delete the last fc layer.
modules = list(resnet50.children())[:-1]
resnet = nn.Sequential(*modules)
resnet50 = torch.nn.DataParallel(resnet50)
resnet50.to(device)