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

UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling') #12

Open
wnoiokjfwa opened this issue Dec 18, 2022 · 2 comments

Comments

@wnoiokjfwa
Copy link

No description provided.

@ggcr
Copy link

ggcr commented Mar 4, 2023

This keeps happening even though I am passing the 'cpu' parameter:

device = torch.device('cpu')

Is there a way to avoid this error popping off in stderr?

@nunombispo
Copy link

The problem is in model.py line 59

@torch.cuda.amp.autocast()

@torch.cuda.amp.autocast() by default always enables CUDA:
image

Remove line 59 and add inside the function:
torch.autocast(device_type=self.device.type)

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

3 participants