You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(rord) robot@robot-System-Product-Name:/app/imgfeature/RoRD-main$ python extractMatch.py demo/rgb/rgb1_1.jpg demo/rgb/rgb1_2.jpg --model_file models/rord.pth
Traceback (most recent call last):
File "extractMatch.py", line 177, in
model = D2Net(
File "/app/imgfeature/RoRD-main/lib/model_test.py", line 62, in init
self.load_state_dict(torch.load(model_file)['model'])
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 592, in load
return _load(opened_zipfile, map_location, pickle_module, pickle_load_args)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 851, in _load
result = unpickler.load()
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 843, in persistent_load
load_tensor(data_type, size, key, _maybe_decode_ascii(location))
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 832, in load_tensor
loaded_storages[key] = restore_location(storage, location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 142, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on CUDA device '
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.**
The text was updated successfully, but these errors were encountered:
The above issue seems to be concerning to map_location argument, in order to resolve:
Replace the line, self.load_state_dict(torch.load(model_file)['model']), here
with : self.load_state_dict(torch.load(model_file, map_location='cuda:0')['model'])
(rord) robot@robot-System-Product-Name:/app/imgfeature/RoRD-main$ python extractMatch.py demo/rgb/rgb1_1.jpg demo/rgb/rgb1_2.jpg --model_file models/rord.pth
Traceback (most recent call last):
File "extractMatch.py", line 177, in
model = D2Net(
File "/app/imgfeature/RoRD-main/lib/model_test.py", line 62, in init
self.load_state_dict(torch.load(model_file)['model'])
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 592, in load
return _load(opened_zipfile, map_location, pickle_module, pickle_load_args)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 851, in _load
result = unpickler.load()
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 843, in persistent_load
load_tensor(data_type, size, key, _maybe_decode_ascii(location))
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 832, in load_tensor
loaded_storages[key] = restore_location(storage, location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "/home/robot/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 142, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on CUDA device '
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.**
The text was updated successfully, but these errors were encountered: