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

Metric aggragation is broken for LoggerCollection #1547

Closed
festeh opened this issue Apr 21, 2020 · 5 comments · Fixed by #2723
Closed

Metric aggragation is broken for LoggerCollection #1547

festeh opened this issue Apr 21, 2020 · 5 comments · Fixed by #2723
Assignees
Labels
bug Something isn't working help wanted Open to be worked on priority: 0 High priority task

Comments

@festeh
Copy link
Contributor

festeh commented Apr 21, 2020

🐛 Bug

After changes in #1278 it is now not possible to log testing metrics after traning while using several loggers.

To Reproduce

Say we want to run a MINST example and also want to add a change - log testing metrics after training. For that we define a Callback

class TestCallback(Callback):
    def on_train_end(self, trainer, pl_module):
        # note that it would crash if you don't pass the `pl_module`
        trainer.test(pl_module)

and pass it to trainer callbacks argument.

We would also like to use several loggers to track all metrics, say MLFlowLogger and TensorBoardLogger. For this we create instances of these loggers and pass them into Trainer in a list.

Expected behavior

Testing metrics should be logged - but they don't as there's no final aggregation when our logger is a LoggerCollection

Additional context

In my opinion, the logic in agg_and_log_metrics and _finalize_agg_metrics is hard to follow, so I'd be happy if user could choose plain old log_metrics which worked nicely.

@festeh festeh added bug Something isn't working help wanted Open to be worked on labels Apr 21, 2020
@Borda
Copy link
Member

Borda commented Apr 21, 2020

are you using the last master?

@festeh festeh changed the title Metric aggragation is broken (even on pl_examples) Metric aggragation is broken for LoggerCollection Apr 22, 2020
@festeh
Copy link
Contributor Author

festeh commented Apr 22, 2020

@Borda thanks! It now works for a single logger. But it seems that problem persists when several loggers are used, so I updated the issue. This happens because metrics to aggregate are not propagated to child loggeres

@kevinc13
Copy link
Contributor

I'm also having this issue with multiple loggers on master. Seems that the test results are printed at the end, but the loggers don't log the test metrics.

@Borda Borda added the priority: 0 High priority task label Apr 25, 2020
@Borda Borda self-assigned this Apr 25, 2020
@kevinc13
Copy link
Contributor

@Borda any update on this issue? I'm still encountering this on the latest release, and it seems related to #1859

@stale
Copy link

stale bot commented Jul 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Jul 25, 2020
@Borda Borda removed the won't fix This will not be worked on label Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on priority: 0 High priority task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants