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

GradientNormClipping callback error #664

Open
dimimal opened this issue May 20, 2020 · 0 comments
Open

GradientNormClipping callback error #664

dimimal opened this issue May 20, 2020 · 0 comments

Comments

@dimimal
Copy link

dimimal commented May 20, 2020

When I insert this callback in the trial I get the following error. Is this some kind of bug?
It seems like the gradients are not passed in the callback.

"""
File "/home/dimitris/.local/lib/python3.6/site-packages/torch/nn/utils/clip_grad.py", line 30, in clip_grad_norm_
total_norm = torch.norm(torch.stack([torch.norm(p.grad.detach(), norm_type) for p in parameters]), norm_type)
RuntimeError: stack expects a non-empty TensorList
"""

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