Hi all, I ecountered a curious problem. A pytorch code looks like

for batch_idx, (imgs, pids, _) in enumerate(trainloader):
print(batch_idx, len(trainloader))

The problem is that the batch_idx variable cannot reach len(trainloader).  Namely, it cannot go through all the data.
Could some tell me how it occurs?
Note that, I test a new dataset, which is normal. However, I check the dataset related code, I cannot find what causes this problem.