-
Notifications
You must be signed in to change notification settings - Fork 60
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
ValueError: optimizer got an empty parameter list #6
Comments
@eeric I am not sure. May I ask what version of pytorch you are using. It works fine on mine. |
it should be: use model.params() instead of model.parameters() |
model.params() works, but why, what's the difference |
If Adam optimizer is used, how to change ? @hansbu @hackershi @danieltan07 |
Got the same problem. If Adam optimizer is used, how to change ? @hansbu @hackershi @danieltan07 |
LeNet model used,
Traceback (most recent call last):
File "main.py", line 155, in
optimizer = optim.SGD(model.parameters(), lr=args.lr, momentum=args.momentum)
File "/usr/local/lib/python3.6/dist-packages/torch/optim/sgd.py", line 64, in init
super(SGD, self).init(params, defaults)
File "/usr/local/lib/python3.6/dist-packages/torch/optim/optimizer.py", line 38, in init
raise ValueError("optimizer got an empty parameter list")
ValueError: optimizer got an empty parameter list
why?
The text was updated successfully, but these errors were encountered: