Solved by jankunze in post #2 
              
              
                After reading this post and this post I was finally able to come up with a working solution. 
Here is the code for my Dataloader: 
import numpy as np
import torch
import torch.utils.data
from torch.utils.data import Dataset
from PIL import Image
import torchvision.transforms as tvtransforms
import t…