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

[Bug Fix/Feature] Enable logging within callback #4167

Closed
wants to merge 18 commits into from

Conversation

tchaton
Copy link
Contributor

@tchaton tchaton commented Oct 15, 2020

What does this PR do?

This PR enables logging within callback containing val and will be extended to all in future commit.

What changed:

  • Add in run_evaluation function, model._result = Result() at the beginning to enable logging on all callbacks.
  • Re-ordering latest hooks call within run_evaluation to happen before pushing to logger.
  • Add a scriptable Callback to simplify tests

Fixes #3813

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?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Oct 15, 2020

Hello @tchaton! Thanks for updating this PR.

Line 222:1: W293 blank line contains whitespace

Line 114:9: E265 block comment should start with '# '

Line 599:1: W293 blank line contains whitespace

Line 5:1: E302 expected 2 blank lines, found 1
Line 7:121: E501 line too long (123 > 120 characters)
Line 7:124: W291 trailing whitespace
Line 26:1: W293 blank line contains whitespace
Line 29:1: W293 blank line contains whitespace
Line 30:32: W292 no newline at end of file

Line 135:1: E302 expected 2 blank lines, found 1

Line 325:1: E302 expected 2 blank lines, found 1
Line 337:121: E501 line too long (176 > 120 characters)
Line 339:1: W293 blank line contains whitespace
Line 378:121: E501 line too long (126 > 120 characters)
Line 378:126: E502 the backslash is redundant between brackets
Line 379:16: E128 continuation line under-indented for visual indent
Line 379:86: E502 the backslash is redundant between brackets
Line 380:80: E502 the backslash is redundant between brackets

Comment last updated at 2020-10-16 10:24:33 UTC

@tchaton tchaton changed the title Create test to validate logging can happen in callback function with val [Bug Fix/Feature] Enable logging within callback Oct 15, 2020
thomas and others added 15 commits October 15, 2020 11:41
* save initial arguments

* typing

* chlog

* .
* fix val epoch agg

* fix val agg metrics

* fix val agg metrics

* fix val agg metrics
* remove duplicate metric vs step log

* remove duplicate metric vs step log

* remove duplicate metric vs step log

* fix ddp index issue
* add test

* fix

* sleepy boy

* chlog

* Apply suggestions from code review

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #4167 into master will increase coverage by 1%.
The diff coverage is 98%.

@@           Coverage Diff           @@
##           master   #4167    +/-   ##
=======================================
+ Coverage      92%     93%    +1%     
=======================================
  Files         103     103            
  Lines        7792    7840    +48     
=======================================
+ Hits         7147    7273   +126     
+ Misses        645     567    -78     

@tchaton tchaton closed this Oct 16, 2020
@tchaton tchaton reopened this Oct 16, 2020
@edenlightning edenlightning added this to the 1.1 milestone Oct 19, 2020
@tchaton tchaton closed this Oct 21, 2020
@tchaton tchaton deleted the bug/fix_3813_log_fails_in_callback branch October 21, 2020 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling module.log(...) within a callback fails
5 participants