Solved by eltoto1219 in post #4 
              
              
                Once you load the dataset, create a dataloader, and since the dataloader and then you can do something like: 
a = iter(dataloader)
b = next(a)

where b is a minibatch. 
An example: 
    dataset = VQA_dataset(ROOT_DIR, train = False)


    loader = torch.utils.data.DataLoader(
                    dat…