Logging in validation step that is the same as training step #9334
Unanswered
RafailFridman
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 1 reply
-
I'm now doing like this: def training_step(self, batch, batch_idx):
logging_prefix = "train" if self.trainer.training else "val"
...
self.log(f"{logging_prefix}/combined_loss", loss, prog_bar=False, on_epoch=True, on_step=False) But maybe there is a better way? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi, my validation step is the same as the training step:
In training step I call logging of some metrics like this:
But what I want to do is replace
"train/combined_loss"
with something likef"{self.current_stage}/combined_loss"
Is it possible to achieve somehow?
Beta Was this translation helpful? Give feedback.
All reactions