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

Cannnot training due to Expected CUDA but got CPU instead #29

Closed
thinhnggia opened this issue Jun 19, 2019 · 3 comments
Closed

Cannnot training due to Expected CUDA but got CPU instead #29

thinhnggia opened this issue Jun 19, 2019 · 3 comments

Comments

@thinhnggia
Copy link

Yesterday before the update of B4 band B5, I can still train the model from scratch, however, after the update, I see that it seems that the drop_connect function in the utils is not set to CUDA as I think, so it would conflict with the input data which is loaded to GPU already

@lukemelas
Copy link
Owner

Yes, this makes sense. I'll fix it tomorrow.

@changwuxie
Copy link

@thinhnggia
you can advise the fuction 'drop_connect' in utils.py
change: random_tensor += torch.rand([batch_size, 1, 1, 1], dtype=inputs.dtype)
to : random_tensor += torch.rand([batch_size, 1, 1, 1], dtype=inputs.dtype,device=inputs.device)
Then it works!

@lukemelas
Copy link
Owner

Thanks, @changwuxie ! Just fixed it.

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