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

torch.autograd.grad(grads, params, grad_outputs=z, only_inputs=True, retain_graph=False) local variable 'z' referenced before assignment #2

Closed
JonathanSchmidt1 opened this issue Aug 12, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@JonathanSchmidt1
Copy link

Hi,
thank you for the implementation. Unfortunately I am having some problems with one variable that is not defined not sure what it's supposed to be:

File "adahessian.py", line 77, in set_hessian h_zs = torch.autograd.grad(grads, params, grad_outputs=z, only_inputs=True, retain_graph=False) UnboundLocalError: local variable 'z' referenced before assignment

@davda54
Copy link
Owner

davda54 commented Aug 12, 2020

Hey, thanks for letting me know, it should be OK in the newest commit :) I was too impatient when refactoring... Is it working properly now?

@davda54 davda54 added the bug Something isn't working label Aug 12, 2020
@davda54 davda54 closed this as completed Aug 13, 2020
@JonathanSchmidt1
Copy link
Author

Is working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants