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

Error when learning rate is big #6

Open
f-cg opened this issue May 7, 2019 · 2 comments
Open

Error when learning rate is big #6

f-cg opened this issue May 7, 2019 · 2 comments

Comments

@f-cg
Copy link

f-cg commented May 7, 2019

python3 main.py --max-depth 4 --lr 1
...
Train Epoch: 3 [17280/60000 (29%)] Loss: 0.522095, Accuracy: 54/64 (84.0000%)
Traceback (most recent call last):
File "main.py", line 79, in
model.train_(train_loader, epoch)
File "/content/model.py", line 190, in train_
correct += pred.eq(target.data).cpu().sum()
RuntimeError: Expected object of backend CPU but got backend CUDA for argument #2 'other'

This is so stange and I can't fix it.

@kimhc6028
Copy link
Owner

do you need high lr? does this bug occur when lr is relatively small? lr=1 seems like unlikely

@f-cg
Copy link
Author

f-cg commented May 8, 2019

Ok, I don't need that high lr, but this issue can happen when lr is smaller and epoch is bigger.

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