I have implemented models in the dictionary but now for Data-Parallel it is not supporting dictionary, any alternate solution in DataParallel
if method =='lloss':
models = {'backbone': resnet18, 'module': loss_module}
torch.backends.cudnn.benchmark = True
#If I use this
models = torch.nn.DataParallel(models, device_ids=[0,1,2])
#or this both methods are giving error
models['backbone'] = torch.nn.DataParallel(models['backbone'], device_ids=[0,1,2])
models['backbone'].cuda()