model = torch.nn.DataParallel(model,device_ids=[0,1]).cuda()
Changed to this, Still it is working on the first gpu only and then exploding which I am giving in CUDA_VISIBLE_DEVICES.
Giving the same error.