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
Hi,
I m trying to run RSS on my MacBook M1, however I ve stuck on the very beginning. I ve installed CPU-only version, however when started the script to run I get such error:
Traceback (most recent call last): File "/opt/miniconda3/envs/rss2/bin/RS2_predict", line 33, in <module> sys.exit(load_entry_point('RS2==1.0', 'console_scripts', 'RS2_predict')()) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 421, in predict_entry_point predict_from_raw_data(args.i, File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 134, in predict_from_raw_data load_what_we_need(checkpoint_name) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 76, in load_what_we_need checkpoint = torch.load(checkpoint_name) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1172, in _load result = unpickler.load() File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1142, in persistent_load typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location)) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1116, in load_tensor wrap_storage=restore_location(storage, location), File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 217, in default_restore_location result = fn(storage, location) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 182, in _cuda_deserialize device = validate_cuda_device(location) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 166, 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.
Not sure how can I resolve this... any suggestions?
Cheers,
Bartek
The text was updated successfully, but these errors were encountered:
I am sorry that I have not tested this code on a MAC.
you can try adding " -device 'cpu' " after the command RS2_predict -i 'path/to/input' -o 'path/to/output' -m 'path/to/pretrained_model.pt'
like RS2_predict -i 'path/to/input' -o 'path/to/output' -m 'path/to/pretrained_model.pt' -device 'cpu'
If there are same error, please modify line 76 of "Rodent-Skull-Stripping/RS2/inference/predict.py": checkpoint = torch.load(checkpoint_name)
to: checkpoint = torch.load(checkpoint_name, map_location=torch.device('cpu'))
Then run: pip uninstall RS2
python setup.py install
to reinstall the framework and try RS2_predict XXX again(with -device 'cpu').
Hi,
I m trying to run RSS on my MacBook M1, however I ve stuck on the very beginning. I ve installed CPU-only version, however when started the script to run I get such error:
Traceback (most recent call last): File "/opt/miniconda3/envs/rss2/bin/RS2_predict", line 33, in <module> sys.exit(load_entry_point('RS2==1.0', 'console_scripts', 'RS2_predict')()) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 421, in predict_entry_point predict_from_raw_data(args.i, File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 134, in predict_from_raw_data load_what_we_need(checkpoint_name) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/RS2-1.0-py3.9.egg/RS2/inference/predict.py", line 76, in load_what_we_need checkpoint = torch.load(checkpoint_name) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1172, in _load result = unpickler.load() File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1142, in persistent_load typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location)) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 1116, in load_tensor wrap_storage=restore_location(storage, location), File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 217, in default_restore_location result = fn(storage, location) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 182, in _cuda_deserialize device = validate_cuda_device(location) File "/opt/miniconda3/envs/rss2/lib/python3.9/site-packages/torch/serialization.py", line 166, 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.
Not sure how can I resolve this... any suggestions?
Cheers,
Bartek
The text was updated successfully, but these errors were encountered: