Skip to content
Discussion options

You must be logged in to vote

Can training step return dictionary?

Yes, check the doc of LightningModule.training_step.

How can I return dict from training_step and display loss in the progress bar at the same time?

just return dict like what you do now and use self.log(loss, prog_bar=True) to display loss in prog_bar.

so I could calculate mean loss at the end of epoch

BTW, If you just want mean loss, I think pytorch_lightning have already done for you and you don't need to modified training_step_end(not sure)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by igoldov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment