question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: can't optimize a non-leaf Tensor

See original GitHub issue

When I try to use the nca part of the dim_reduct example I get ValueError: can't optimize a non-leaf Tensor, any idea what could be wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinzakkacommented, Feb 18, 2020

Hey @joaogui1, should be fixed in the newest commit thanks to @brentyi ! Cheers

0reactions
kevinzakkacommented, Mar 5, 2020

@lidh15 forgot to push it to pypi, should be available shortly. Do let me know if it works out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: can't optimize a non-leaf Tensor? - PyTorch Forums
Dear all: i know when x_cuda = x_cpu.to(device) It will trigger error: ValueError: can't optimize a non-leaf Tensor when you use optimizer ...
Read more >
torch.optim returns "ValueError: can't optimize a non-leaf ...
Only leaf tensors can be optimised. A leaf tensor is a tensor that was created at the beginning of a graph, i.e. there...
Read more >
confusing error message ValueError: can't optimize a non-leaf ...
Your first line fails because each tensor happens to be an iterable of slices so the optimizer class receives slices of parameters, i.e....
Read more >
ValueError: can't optimize a non-leaf Tensor
I am following an example like below which is working in early 2020 year : from torch.optim import Adam pyro.clear_param_store() def ...
Read more >
Value Error : can't optimize a non-leaf Tensor - fastai dev
optimizer = torch.optim.Adam(dp_module.parameters() , lr = 1e-3). It gives error as. ValueError: can't optimize a non-leaf Tensor .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found