RuntimeError: cuda runtime error (11) : invalid argument

Hi, all,

When I set the batch size is 8, the code runs fine. While I increase the batch size to 16, the following error occurs:

RuntimeError: cuda runtime error (11) : invalid argument at /pytorch/aten/src/THC/generic/ THCTensorMath.cu:33

If the batch size is so large that it uses up all memory, it should report ‘out of memory problem’. So I do not know what cause the ‘invalid argument’ problem.

anyone has clue to solve it?