With this line, pytorch tries to load the weights on the GPU and throws an error if it can't. The following update should solve the issue:
if model_file is not None:
if use_cuda:
self.load_state_dict(torch.load(model_file)['model'])
else:
self.load_state_dict(torch.load(model_file, map_location='cpu')['model'])
https://github.com/mihaidusmanu/d2-net/blob/81983664d1a29fabf09636b3735c5df9151db600/lib/model_test.py#L61
With this line, pytorch tries to load the weights on the GPU and throws an error if it can't. The following update should solve the issue:
if model_file is not None: if use_cuda: self.load_state_dict(torch.load(model_file)['model']) else: self.load_state_dict(torch.load(model_file, map_location='cpu')['model'])