How to fix this strange error: "RuntimeError: CUDA error: out of memory"
I successfully trained the network but got this error during validation:

RuntimeError: CUDA error: out of memory


The error occurs because you ran out of memory on your GPU.
One way to solve it is to reduce the batch size until your code runs without this error.
