I had a similar problem trying to add an extra layer on top of a pretrained model and I tried this solution. However this new class doesn’t seem to be able to use the 2 GPUs even tho I load it on DataParallel. The previous model loads just fine when I train it even if I load it with
This makes no sense to me but I can’t seem to fix it after numerous tries, has it occured to you too?
Is there something else I have to do to make the new model run on DataParallel?
model = Model.One_More_Module(pretrained_model) #One_More_Module is a class that takes another network and creates one more layer

model = torch.nn.DataParallel(model).cuda()