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

Logger isn't finalized upon test/predict completion #8333

Closed
mooey5775 opened this issue Jul 8, 2021 · 2 comments · Fixed by #8685
Closed

Logger isn't finalized upon test/predict completion #8333

mooey5775 opened this issue Jul 8, 2021 · 2 comments · Fixed by #8685
Assignees
Labels
bug Something isn't working help wanted Open to be worked on
Milestone

Comments

@mooey5775
Copy link

🐛 Bug

Some loggers (like TensorBoardLogger) require flushing/finalize to be called for logged metrics to be properly written to disk. However, finalize is not currently called after test/predict runs.

This manifests in metrics failing to be logged if .test or .predict is run on Trainer with a TensorBoardLogger.

I believe this could be fixed with an extra .finalize call (like what is already in https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/loops/fit_loop.py#L265-L266) in EvaluationLoop and PredictionLoop. I'm not entirely sure if adding this would cause any issues though, so I'm a bit hesitant to submit a PR myself.

To Reproduce

https://colab.research.google.com/drive/14j7qCoy33y4giqjA8xNfNMCK81F_OvFH?usp=sharing

Expected behavior

Metrics should be logged, regardless of whether .fit, .test, or .predict is called.

Environment

  • CUDA:
    • GPU:
    • available: False
    • version: 10.2
  • Packages:
    • numpy: 1.19.5
    • pyTorch_debug: False
    • pyTorch_version: 1.9.0+cu102
    • pytorch-lightning: 1.4.0dev
    • tqdm: 4.41.1
  • System:
    • OS: Linux
    • architecture:x
      • 64bit
    • processor: x86_64
    • python: 3.7.10
    • version: # 1 SMP Sat Jun 5 09:50:34 PDT 2021
@mooey5775 mooey5775 added bug Something isn't working help wanted Open to be worked on labels Jul 8, 2021
@mooey5775
Copy link
Author

@ananthsub

@ananthsub
Copy link
Contributor

@awaelchli this is what #8217 was attempting to solve

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
Projects
None yet
3 participants