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

[Fix] Fix error format of log message #508

Merged
merged 5 commits into from
Oct 18, 2022

Conversation

HAOCHENYE
Copy link
Collaborator

@HAOCHENYE HAOCHENYE commented Sep 2, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

If the interval of LoggerHook is smaller than the window_size of LogProcessor, time and data_time in log string are not formatted by LogProcessor:

image

Modification

LogProcessor assumes time, data_time and eta will appear at the same time(Generated by IterTimerHook). However, the previous implementation of IterTimerHook will only record eta after window_size iterations, which causes time, eta and data_time are not caught by LogProcessor. Therefore, time and data_time are formatted as expected,

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Base: 78.07% // Head: 77.55% // Decreases project coverage by -0.52% ⚠️

Coverage data is based on head (244f705) compared to base (36af1f0).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 244f705 differs from pull request most recent head d326416. Consider uploading reports for the commit d326416 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
- Coverage   78.07%   77.55%   -0.53%     
==========================================
  Files         125      116       -9     
  Lines        8991     8606     -385     
  Branches     1845     1774      -71     
==========================================
- Hits         7020     6674     -346     
+ Misses       1659     1637      -22     
+ Partials      312      295      -17     
Flag Coverage Δ
unittests 77.55% <100.00%> (-0.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmengine/hooks/iter_timer_hook.py 100.00% <100.00%> (ø)
mmengine/utils/misc.py 37.74% <0.00%> (-13.25%) ⬇️
mmengine/model/utils.py 57.31% <0.00%> (-6.15%) ⬇️
mmengine/optim/optimizer/default_constructor.py 95.57% <0.00%> (-2.66%) ⬇️
mmengine/utils/dl_utils/collect_env.py 44.44% <0.00%> (-0.77%) ⬇️
mmengine/runner/checkpoint.py 44.00% <0.00%> (-0.64%) ⬇️
mmengine/hooks/checkpoint_hook.py 89.83% <0.00%> (-0.47%) ⬇️
mmengine/hooks/logger_hook.py 98.70% <0.00%> (-0.14%) ⬇️
mmengine/model/__init__.py 75.00% <0.00%> (ø)
mmengine/fileio/__init__.py 100.00% <0.00%> (ø)
... and 21 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ZwwWayne ZwwWayne added this to the 0.2.0 milestone Sep 5, 2022
@HAOCHENYE
Copy link
Collaborator Author

Solve #582

@ZwwWayne ZwwWayne requested a review from C1rN09 October 8, 2022 11:54
@zhouzaida zhouzaida linked an issue Oct 13, 2022 that may be closed by this pull request
@C1rN09 C1rN09 added the ready ready to merge label Oct 13, 2022
@ZwwWayne ZwwWayne modified the milestones: 0.2.0, 0.3.0 Oct 18, 2022
@ZwwWayne ZwwWayne merged commit aaba1d8 into open-mmlab:main Oct 18, 2022
C1rN09 pushed a commit to C1rN09/mmengine that referenced this pull request Nov 1, 2022
* Fix error format of log message

* Fix unit test

* remove unnecessary comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ETA information disappears when iter num smaller than window_size
3 participants