Solved by ejguan in post #2 
              
              
                You are printing the length of dataset, which should remain same. If you directly call len(train_loader) and len(val_loader), you should get expected results.