tensor in validation_step cannot flow a gradient #17906
Unanswered
Nokimann
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
I solved the problem by setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to calculate the gradient of
pos
from the model output during the validation.I didn't execute
trainer.fit(lit_model)
Instead, I executed justtrainer.validate(lit_model)
, overriding withI expected the results as
But I got the results,
What causes the
False
requires_grad
?Beta Was this translation helpful? Give feedback.
All reactions