Solved by 1Konny in post #2 
              
              
                AFAIK,  there are many ways to achieve your goal. Here are two examples. 
dloader = DataLoader(dset, batch_size=batch_size, drop_last=True, shuffle=True)
loader = iter(dloader)
while True:
    try:
        img, label = loader.next()
    except StopIteration:
        loader = iter(dloader)
        im…