Solved by apaszke in post #2 
              
              
                I’d recommend creating a new dataset and concatenating the images there, so the copy will be done inside the worker processes: 
class ConcatDataset(torch.utils.data.Dataset):
    def __init__(self, *datasets):
        self.datasets = datasets

    def __getitem__(self, i):
        return tuple(d[i] …