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
I download the source code and run on terminal ' python run.py --source=0 --frame-rate25 '
I got this error message.
init
Traceback (most recent call last):
File "run.py", line 65, in
runPOS(source)
File "run.py", line 39, in call
capture = CaptureFrames(self.batch_size, source, show_mask=True)
File "/Users/jaehyuni/Desktop/rPPG-master/rPPG/capture_frames.py", line 21, in init
self.model.load_state_dict(torch.load('linknet.pth'), map_location='cpu')
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 787, in _legacy_load
result = unpickler.load()
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 743, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 135, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
My environment is python3.8 with MacBookAir(M1) .
I download the source code and run on terminal ' python run.py --source=0 --frame-rate25 '
I got this error message.
init
Traceback (most recent call last):
File "run.py", line 65, in
runPOS(source)
File "run.py", line 39, in call
capture = CaptureFrames(self.batch_size, source, show_mask=True)
File "/Users/jaehyuni/Desktop/rPPG-master/rPPG/capture_frames.py", line 21, in init
self.model.load_state_dict(torch.load('linknet.pth'), map_location='cpu')
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 787, in _legacy_load
result = unpickler.load()
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 743, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "/opt/homebrew/Caskroom/miniforge/base/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 135, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
So, I entered capture_frames.py .
edit
self.model.load_state_dict(torch.load('linknet.pth'), map_location='cpu')
Still the same error occurs.
Help me plz!
The text was updated successfully, but these errors were encountered: