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

RuntimeError in cd_model_unc_cifar10_wine.ipynb example #439

Closed
ascillitoe opened this issue Jan 25, 2022 · 0 comments · Fixed by #445
Closed

RuntimeError in cd_model_unc_cifar10_wine.ipynb example #439

ascillitoe opened this issue Jan 25, 2022 · 0 comments · Fixed by #445

Comments

@ascillitoe
Copy link
Contributor

From @KevinRyu in #432:

In cd_model_unc_cifar10_wine.ipynb example, .cuda() should be added to reg model variable.
If this is not applied, I got below error.

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_addmm)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
trainer(reg.cuda(), nn.MSELoss(), X_train_dl, device, torch.optim.Adam, learning_rate=0.001, epochs=30)
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 a pull request may close this issue.

1 participant