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

object has no attribute 'is_cuda' in python 3.6 #6

Closed
neozhangthe1 opened this issue Nov 9, 2017 · 1 comment
Closed

object has no attribute 'is_cuda' in python 3.6 #6

neozhangthe1 opened this issue Nov 9, 2017 · 1 comment

Comments

@neozhangthe1
Copy link

Error message:

AttributeError: 'Seq2Seq' object has no attribute 'is_cuda'

../../../../anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py:262: AttributeError

@neozhangthe1
Copy link
Author

It can be fixed by modifying

@property
def is_cuda(self):
    return self.parameters().next().is_cuda

to

@property
def is_cuda(self):
    return next(self.parameters()).is_cuda

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

1 participant