davda54 / ada-hessian

Easy-to-use AdaHessian optimizer (PyTorch)
MIT License
77 stars 15 forks source link

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

Closed JonathanSchmidt1 closed 4 years ago

JonathanSchmidt1 commented 4 years ago

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 commented 4 years ago

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?

JonathanSchmidt1 commented 4 years ago

Is working fine now.