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

Possible to use with PyTorch Lightning? #29

Open
shaunster0 opened this issue Jun 6, 2022 · 1 comment
Open

Possible to use with PyTorch Lightning? #29

shaunster0 opened this issue Jun 6, 2022 · 1 comment

Comments

@shaunster0
Copy link

is it possible to use this library with PyTorch Lightning? if so, could you please provide an example?

using PyTorch Lightning in 'manual mode', using
self.manual_backward(loss, create_graph=True)

was the closest I got, but it still wouldnt work. It ran somewhat but crashed after a few batches saying

RuntimeError: Gradient tensor 2 does not have grad_fn. When calling loss.backward(), make sure the option create_graph is set to True.

(even though I did set this)

@jloveric
Copy link

I've used this with lightning before, not sure about the issue you're seeing though.

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

2 participants