Thanks for the information.
The easiest way would be to create a custom Dataset and load the data and target as necessary.
I assume you have the input data stored as images and the targets as some kind of arrays?
Here is a small dummy example of a custom Dataset:
class MyDataset(Dataset):
    def __init__(self, image_paths, target_paths, transform=None):
        self.image_paths = image_paths
        self.target_paths = target_paths
        self.transform = transform
        
    def __getitem__(self, index):
        x = Image.open(self.image_paths[index])
        y = torch.from_numpy(np.load(self.target_paths[index]))
        
        if self.transform:
            x = self.transform(x)
            
        return x, y
    
    def __len__(self):
        return len(self.image_paths)