Open STRUGGLE1999 opened 1 year ago
It seems some tensors are put in CPU will some are in GPU. You can put all tensors on the GPU to fix this problem.
Did you find the location of the problem, please?
Hi, This issue can be resolved by changing the following two lines: output, = model(image[None],0) output = postprocessors['bbox'](output, torch.Tensor([[1.0, 1.0]]))[0] to ---> output, = model.cuda()(image[None].cuda(),0) output = postprocessors['bbox'](output, torch.Tensor([[1.0, 1.0]]).cuda())[0]
I want to visualize the results, but when I run python inference.py,it broke an error:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)