deep_sort_pytorch
deep_sort_pytorch copied to clipboard
RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1.
Hi,
I am trying to run the demo_yolov3_deepsort.py with the original_ckpt.t7 model but received this following error as it's not the case for the ckpt.t7 model, do you have any idea?
RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.
I am doing this because I noticed that the tracking performance is not as good as the official implementation in TF. Specifically, the ID switching problem is more noticeable.
@anhminh3105
Faced the same issue but was able to resolve it by using map_location while loading the weights:
checkpoint = torch.load("original_ckpt.t7", map_location='cuda:0')
net_dict = checkpoint['net_dict']
net.load_state_dict(net_dict)
net.eval()
Hope it helps!