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

出现错误ValueError: optimizer got an echuxian mpty parameter list #13

Closed
Shank2358 opened this issue Aug 5, 2020 · 6 comments
Closed

Comments

@Shank2358
Copy link

在加载完模型之后出现错误ValueError: optimizer got an empty parameter list

定位到的报错位置是
File "train.py", line 76, in
optimizer = optim.Adam(filter(lambda p: p.requires_grad, model.parameters()), lr=cfg.LR)

@lxztju
Copy link
Owner

lxztju commented Aug 6, 2020

这是优化器定义时,不小心写错了模型的名字,已经改过来

@Shank2358
Copy link
Author

Shank2358 commented Aug 8, 2020

嗯嗯谢谢,我也按照那个修改了。现在出现了另外一个问题就是初始化模型之后直接结束了,GPU也没有启动,我检查了一下数据格式和dataloader好像没有问题(我之前怀疑是数据错误导致抛出异常),检查了一下发现加载数据都是正常的,请问您有遇到过这样的情况吗,我在另外一个issue里面也看到了类似问题。谢谢。
image

@PngYng
Copy link

PngYng commented Sep 9, 2020

在加载完模型之后出现错误ValueError: optimizer got an empty parameter list

定位到的报错位置是
File "train.py", line 76, in
optimizer = optim.Adam(filter(lambda p: p.requires_grad, model.parameters()), lr=cfg.LR)

你好请问这个具体在哪里修改呀,我没找见,出现了同样的错误

@PngYng
Copy link

PngYng commented Sep 11, 2020

这是优化器定义时,不小心写错了模型的名字,已经改过来

你好请问这个具体在哪里修改呀,我没找见,出现了同样的错误

@DnYoZn
Copy link

DnYoZn commented Oct 12, 2020

这是优化器定义时,不小心写错了模型的名字,已经改过来

你好请问这个具体在哪里修改呀,我没找见,出现了同样的错误

你这个问题解决了吗

@dmuqlzhang
Copy link

这是优化器定义时,不小心写错了模型的名字,已经改过来

你好请问这个具体在哪里修改呀,我没找见,出现了同样的错误

你这个问题解决了吗

已解决问题,train.py 43行param.requires_grad = False,将False改为True即可正常训练

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

5 participants