Hi,
I am trying to run my model on multiple GPUs for data parallelism but receiving this error:
AttributeError: 'DataParallel' object has no attribute 'fc'

I have defined the following pretrained model :
def resnet50(num_classes, device):
    model = models.resnet50(pretrained=True)
    model = torch.nn.DataParallel(model)
    for p in model.parameters():
        p.requires_grad = False
    num_ftrs = model.fc.in_features
    model.fc = nn.Linear(num_ftrs, num_classes)

    model = model.to(device)
    return model

It’s unclear to me where I can add “module”
Cheers