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

Models that require CUDA don't work by default #17

Open
jeremyfowers opened this issue Dec 1, 2023 · 0 comments
Open

Models that require CUDA don't work by default #17

jeremyfowers opened this issue Dec 1, 2023 · 0 comments
Labels
bug Something isn't working model Pertaining to the models corpus //models/ p2 Low priority

Comments

@jeremyfowers
Copy link
Collaborator

Models that expect CUDA to be installed do not work by default on tkml.

Reproduction

turnkey onnxmodelzoo\toolchain\models\torch_hub\mealv1_resnest50.py

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.

Workaround

Installing torch+cuda with pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 solves the issue.

Possible solutions:

  1. Add some logic to skip these models if CUDA is not installed, like if not torch.cuda.is_available(): return
  2. See if the models can be fixed with something like model.device("cpu")
  3. Remove models from the turnkey corpus that require CUDA

cc @danielholanda @ramkrishna2910 @andyluo7

@jeremyfowers jeremyfowers added bug Something isn't working model Pertaining to the models corpus //models/ p2 Low priority labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working model Pertaining to the models corpus //models/ p2 Low priority
Projects
None yet
Development

No branches or pull requests

1 participant