RuntimeError: reduce failed to get memory buffer: out of memory - After 30,000 iterations

Hello thank you for the suggestions. I will check further.

I have also edited my original post to indicate that I have pin_memory set to true. I read in some threads that it might result in oom What is the disadvantage of using pin_memory? and I was wondering if this might be the case for me?