DataLoader index exceeding dataset size?

Hi! I’m training a model right now, and it crashes on an error that I didn’t think should be possible (it claims there’s negative values for something that ranges only from 0 to 1). As I debugged that issue, I had it print in the getitem function of my Dataset class any time the minimum value in the array was less than 0, and I had it print the index number.

After running for some time, it did indeed hit a negative value, but the index it printed was 3211861. My data is of shape (1581,2,150,224,30), and my batch_size is 10. Does anyone have any similar experiences, where the index was absurdly large like that? Or is that indicative of a bug related to that?

Can you share your getitem function?