Skip to content

added support for running demos on CPU when no CUDA devices are found #12

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

glhr
Copy link

@glhr glhr commented Sep 26, 2020

The current demo implementation gives an AssertionError when no NVidia driver is found. I replaced .cuda() with .to(device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')) so that the image and webcam demos can be run on CPU when no CUDA device is found.

@HanClinto
Copy link

Works great, thank you!!

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

Successfully merging this pull request may close these issues.

2 participants