Don’t push the I tensor to the device in your __getitem__ method.
Since each worker in your DataLoader will use an own dataset, you will run into these multiprocessing issues as mentioned before.
Remove I = I.cuda() from __getitem__ and move it to the training loop:
for data in loader:
    data = data.cuda()
    ...