Could you share your data loader code?
Yes, it should not happen. in fact that is the whole point of having a data loader.
One possible reason I can think of - if you’re not scaling them to a fixed size while reading them, then it’s possible that a very large image makes your batch too large for your GPU.
It might be useful to see how your GPU usage grows over time across iterations. If it grows with every iteration, there’s a problem. If it suddenly grows out of bounds, there’s a problem in that batch. Anyway, let’s start by seeing your code!