Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to print acc while training? #4850

Closed
fire717 opened this issue Nov 25, 2020 · 7 comments
Closed

How to print acc while training? #4850

fire717 opened this issue Nov 25, 2020 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@fire717
Copy link

fire717 commented Nov 25, 2020

🚀 Feature

Hi, I wanna print acc(or other metrics) while training in the traing bar,(just like Keras).

And for pytorch, I can compute cumulative acc for every training batch and print it,
However, In lightning, maybe I can compute cumulative acc in training_step(), but it seems like I can only print at the val time? How to print it in the training bar?

I am new to pytorch-lightning, so maybe there is something I missed in the docs?

Motivation

To know the training status at every batch, not every epoch (like training_epoch_end() ).

possibly related issue: 100

@fire717 fire717 added feature Is an improvement or enhancement help wanted Open to be worked on labels Nov 25, 2020
@github-actions
Copy link
Contributor

Hi! thanks for your contribution!, great first issue!

@fire717
Copy link
Author

fire717 commented Nov 25, 2020

Like in Keras:

We set:
model.compile(loss="categorical_crossentropy", optimizer=opt, metrics=['acc'])

Then can get:
25/5405 [..............................] - ETA: 1:13:15 - loss: 0.7136 - acc: 0.6556

And default in lightning:
Epoch 0: 5%|██▉ | 63/1353 [00:22<07:50, 2.74it/s, loss=0.71, v_num=20

Only have loss.

@justusschock
Copy link
Member

Hey thanks for your question.

In lightning we have the Metrics Package that also describes it's usage and if you log them with prog_bar=True they will also appear on your progress bar as described here.

Hope this answers your question :)

@justusschock justusschock added question Further information is requested and removed feature Is an improvement or enhancement help wanted Open to be worked on labels Nov 25, 2020
@justusschock justusschock self-assigned this Nov 25, 2020
@fire717
Copy link
Author

fire717 commented Nov 25, 2020

Thx, it seems like useful! I am going to have a try!

@fire717
Copy link
Author

fire717 commented Nov 25, 2020

It is a little strange, when I run in version 1.0.8, the bar cannot show acc and loss is nan,
while I change to v1.0.0, the bar can show loss value and acc .

@justusschock
Copy link
Member

cc @teddykoker @ananyahjha93 any idea on this?

@ananyahjha93
Copy link
Contributor

I'll have to see what changes have been added in between, nothing that I am aware of should cause this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants