What shape does self.patches have? Is it [15000, 1, 64, 64]?
If so, I assume dim0==15000 are the number of samples?
If that’s also correct, I think you are returning the wrong __len__, as self.patches.shape[-1] would return 64 instead of 15000, so your max. batch size would be 64 and you would only load patches[:64].