Pytorch-lightning: TrainResult doesn't log to tensorboard by default

Created on 17 Aug 2020  路  7Comments  路  Source: PyTorchLightning/pytorch-lightning

This is my code:

        result = pl.TrainResult(minimize=loss)
        result.log('train_loss', loss, prog_bar=True)

tensorboard logger doesn't show train_loss.
EvalResult is normal, it can log to tensorboard by default.

Priority P0 bug / fix help wanted

Most helpful comment

I have the same issue with tensorboard==2.2.0, pytorch-lightning==0.9.0.

Edit: OK, found the reason. Trainer's row_log_interval argument is set to 50 by default. If the number of batches is less than row_log_interval, train metrics are never logged.

All 7 comments

cc @williamFalcon

Hey @xiadingZ, which version of tensorboard are you using? I ran into some issues if I wasn't using the PyPI version of tensorboard==2.2.0.

Also, which version of PTL are you using?

2.2.0. But I tried 2.3.0 and it have same issue, no TrainResult's log

can you post a colab that replicates this?
i suspect you might be doing something weird for config since we test that things are actually logged when expected...

I have manually verified this works, see this colab: https://colab.research.google.com/drive/1aD1sEYNBLHISvnsUhRzyyOLZtMkk-LWs?usp=sharing.

Please send a colab or code so we can see what the issue is. Closing for now.

I have the same issue with tensorboard==2.2.0, pytorch-lightning==0.9.0.

Edit: OK, found the reason. Trainer's row_log_interval argument is set to 50 by default. If the number of batches is less than row_log_interval, train metrics are never logged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

williamFalcon picture williamFalcon  路  3Comments

justusschock picture justusschock  路  3Comments

monney picture monney  路  3Comments

iakremnev picture iakremnev  路  3Comments

DavidRuhe picture DavidRuhe  路  3Comments