Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run without CUDA #13

Open
Connor-Bowley opened this issue Jun 24, 2022 · 1 comment
Open

Cannot run without CUDA #13

Connor-Bowley opened this issue Jun 24, 2022 · 1 comment

Comments

@Connor-Bowley
Copy link
Contributor

Connor-Bowley commented Jun 24, 2022

It would be good to be able to run without CUDA. I got the following error:

CLI execution failed: 
 
CrownSegmentationcli standard error:

Traceback (most recent call last):
  File "/data/Projects-build/salt-general/SlicerJawSegmentation-build/lib/SlicerSALT-5.1/cli-modules/CrownSegmentationcli.py", line 297, in <module>
    main(sys.argv[1], sys.argv[2], int(sys.argv[3]), int(sys.argv[4]), sys.argv[5],sys.argv[6], sys.argv[7], sys.argv[8])
  File "/data/Projects-build/salt-general/SlicerJawSegmentation-build/lib/SlicerSALT-5.1/cli-modules/CrownSegmentationcli.py", line 145, in main
    model.load_state_dict(torch.load(unet_model))
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 1046, in _load
    result = unpickler.load()
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 1016, in persistent_load
    load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 1001, in load_tensor
    wrap_storage=restore_location(storage, location),
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 176, in default_restore_location
    result = fn(storage, location)
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 152, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "/home/connor/Projects-build/salt-general/build-5-2/python-install/lib/python3.9/site-packages/torch/serialization.py", line 136, 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.
@juanprietob
Copy link
Contributor

Working on it.
The pull request #22 should address this issue.
@HUTIN1 please help test if it works without CUDA now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants