simple-faster-rcnn-pytorch
simple-faster-rcnn-pytorch copied to clipboard
CUDA_ERROR_INVALID_HANDLE: invalid resource handle occured when using another gpu instead of the default card(0)
My server has multi gpus, when I change '.cuda()' to '.cuda(1)', exception occured: cupy.cuda.driver.CUDADriverError: CUDA_ERROR_INVALID_HANDLE: invalid resource handle
I also add 'os.environ["CUDA_VISIBLE_DEVICES"] = 1', but it doesn't work.
Can anyone tell me how to solve it?
try to change all .cuda() to .to("cuda:1"),
or at the very beginning of code write torch.cuda.set_device(1) and keep all .cuda() unchanged