RuntimeError: CUDA error: out of memory solution (valid for pro-test)

Said earlier, I am in the model test and not appear this error when training, as for the model training report this error, please refer to my another blog: runtimeerror: about errors CUDA out of memory. The Tried to the allocate 1.17 GB
actually very simple solution, originally I procedures specify the gpu is 3, run the test code is called the title out of memory error, the diagram below:

I specified the gpus as 2 and 3, and then ran the code without error.

Read More: