Skip to content

pytorch version? #8

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
bruce1408 opened this issue Aug 29, 2019 · 1 comment
Open

pytorch version? #8

bruce1408 opened this issue Aug 29, 2019 · 1 comment

Comments

@bruce1408
Copy link

when i run the code, there is error :RuntimeError: CUDA error: invalid device ordinal

@thschaaf
Copy link

thschaaf commented Oct 2, 2019

I ran into the same issue. My solution was to changing DEVICES = [2] to DEVICES = [0] in config.py.

If you are using a newer PyTorch version (e.g. 1.1) you also need to fix a few lines related to getting at the value of a tensor. The error message from PyTorch are very helpful here. For example in data_loader.py you need to replace idx = idx.data[0] with idx = idx.data.item() and in 'Train.ipynb' this_loss = loss.data[0] with this_loss = loss.data.item() .

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

2 participants