How to log a Tensor Metric #9007
Unanswered
wellhowtosay
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 2 comments
-
I think it would be |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, doing However, you can provide the metric directly as suggested by @talhaanwarch. |
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.
-
I implement a Metric which returns a Tensor or a Scalar in compute, I try to log the Metric in *_step like:
but meet this:
pytorch_lightning.utilities.exceptions.MisconfigurationException: The metric
tensor([0.0541, 1.0000, 0.1026, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, inf])
does not contain a single element, thus it cannot be converted to a scalar.Exception ignored in: <function tqdm.del at 0x7f8ba571f710>
I use self.log because I need it's on_epoch option to sync metric states among multi gpus at the end of eval/test epoch.
How can I fix it or is there a alternative.
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions