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

如何切换成CPU运行呢? #1

Open
xiaoxuz opened this issue Jun 27, 2018 · 3 comments
Open

如何切换成CPU运行呢? #1

xiaoxuz opened this issue Jun 27, 2018 · 3 comments

Comments

@xiaoxuz
Copy link

xiaoxuz commented Jun 27, 2018

No description provided.

@justdark
Copy link
Owner

去掉 model.cuda() 就可以了

@xiaoxuz
Copy link
Author

xiaoxuz commented Jul 1, 2018

执行sample.py报错 请问是什么原因
Traceback (most recent call last):
File "sample.py", line 40, in
print sample("春".decode('utf-8'))
File "sample.py", line 31, in sample
w = ix_to_word[topi]
KeyError: tensor(2914)

@czb2133
Copy link

czb2133 commented May 8, 2019

执行sample.py报错 请问是什么原因
Traceback (most recent call last):
File "sample.py", line 40, in
print sample("春".decode('utf-8'))
File "sample.py", line 31, in sample
w = ix_to_word[topi]
KeyError: tensor(2914)

作者的环境是python2,print还不用加括号,你用python3的话要加括号

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