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

Added basic file logger #2721

Merged
merged 13 commits into from
Aug 6, 2020
Merged

Conversation

motlikm
Copy link
Contributor

@motlikm motlikm commented Jul 27, 2020

What does this PR do?

This PR implements basic file logger as discussed in #1803

Fixes #1803

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

@mergify mergify bot requested a review from a team July 27, 2020 08:27
@motlikm motlikm force-pushed the 1803_file_logger branch from 54e57aa to 35c235d Compare July 27, 2020 08:36
@motlikm motlikm marked this pull request as ready for review July 27, 2020 08:39
@motlikm motlikm force-pushed the 1803_file_logger branch from 35c235d to f0d37de Compare July 27, 2020 08:42
@Borda Borda added the feature Is an improvement or enhancement label Jul 27, 2020
Copy link
Member

@justusschock justusschock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already looks pretty good. The comments for docstrings and typing apply to all functions and classes :)

pytorch_lightning/loggers/file_logger.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/file_logger.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/file_logger.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/file_logger.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/file_logger.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team July 27, 2020 13:39
Copy link
Member

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice 😃 Agree that this should be changed renamed to CSVLogger. It would also be good to add the save_dir property to the logger so that checkpoints are saved in the right place (this may just mean renaming the root_dir property?)

@mergify mergify bot requested a review from a team July 28, 2020 09:20
@Borda
Copy link
Member

Borda commented Jul 28, 2020

This looks really nice Agree that this should be changed to CSVLogger. It would also be good to add the save_dir property to the logger so that checkpoints are saved in the right place (this may just mean renaming the root_dir property?)

I am not very convinced about CSV format for logging, then you would have plant hard time with any separator you use...

@ethanwharris
Copy link
Member

This looks really nice Agree that this should be changed to CSVLogger. It would also be good to add the save_dir property to the logger so that checkpoints are saved in the right place (this may just mean renaming the root_dir property?)

I am not very convinced about CSV format for logging, then you would have plant hard time with any separator you use...

@Borda Whoops, should have said 'should be renamed to CSVLogger' since that's what it already does (but called FileLogger currently). Presumably if people want more options (e.g. different delimiters, JSON logging, etc.) then these can be added later on?

@motlikm motlikm changed the title Added basic file logger #1803 WIP: Added basic file logger #1803 Jul 30, 2020
@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #2721 into master will decrease coverage by 4%.
The diff coverage is 98%.

@@           Coverage Diff           @@
##           master   #2721    +/-   ##
=======================================
- Coverage      90%     86%    -4%     
=======================================
  Files          78      79     +1     
  Lines        7055    7161   +106     
=======================================
- Hits         6362    6177   -185     
- Misses        693     984   +291     

@motlikm motlikm changed the title WIP: Added basic file logger #1803 Added basic file logger #1803 Jul 30, 2020
@motlikm
Copy link
Contributor Author

motlikm commented Jul 30, 2020

This looks really nice 😃 Agree that this should be changed renamed to CSVLogger. It would also be good to add the save_dir property to the logger so that checkpoints are saved in the right place (this may just mean renaming the root_dir property?)

@ethanwharris Added save_dir property. Now it should be consistent with the TensorboardLogger implementation.

@motlikm motlikm requested review from justusschock and removed request for a team July 30, 2020 08:46
@mergify mergify bot requested a review from a team July 30, 2020 08:46
Copy link
Member

@justusschock justusschock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@mergify mergify bot requested a review from a team July 30, 2020 08:55
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very similar to Test-Tube logger, mind clarify what is the difference?

@mergify mergify bot requested a review from a team July 30, 2020 09:29
@motlikm
Copy link
Contributor Author

motlikm commented Jul 30, 2020

This looks very similar to Test-Tube logger, mind clarify what is the difference?

@Borda Yes, it's true it was inspired by the Test-Tube logger as suggested in this comment. The difference is that this logger has no 3rd party deps (pandas).

@Borda
Copy link
Member

Borda commented Jul 30, 2020

well, would it be easier to make test-tube lighter? @williamFalcon

Copy link
Member

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - confirmed working locally 😃

@mergify mergify bot requested a review from a team July 30, 2020 10:21
@Borda Borda changed the title Added basic file logger #1803 Added basic file logger Jul 30, 2020
@Borda Borda force-pushed the 1803_file_logger branch from d8f8371 to 77141d4 Compare August 5, 2020 16:11
@Borda Borda changed the title [WIP] Added basic file logger Added basic file logger Aug 5, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 5, 2020

This pull request is now in conflict... :(

CHANGELOG.md Outdated Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/csv_logs.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team August 5, 2020 19:18
@Borda Borda force-pushed the 1803_file_logger branch from 259af6a to e242290 Compare August 5, 2020 19:43
@@ -226,6 +232,7 @@ def on_batch_start(self, trainer, pl_module):
@pytest.mark.skipif(platform.system() == "Windows", reason="Distributed training is not supported on Windows")
@pytest.mark.parametrize("logger_class", [
TensorBoardLogger,
# CSVLogger, # todo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any idea why this test is failing?
cc: @PyTorchLightning/core-contributors

@Borda Borda force-pushed the 1803_file_logger branch from 0da2d46 to ee31215 Compare August 5, 2020 23:18
@Borda Borda added the ready PRs ready to be merged label Aug 6, 2020
@Borda Borda force-pushed the 1803_file_logger branch from ee31215 to 6a85720 Compare August 6, 2020 08:33
@williamFalcon williamFalcon merged commit 767c449 into Lightning-AI:master Aug 6, 2020
Copy link

@Hecim1984 Hecim1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏻🚀

@mergify mergify bot removed the ready PRs ready to be merged label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a basic logger which does not require ports
7 participants