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 the bug that the training log and evaluating log are mixed #1252

Merged
merged 10 commits into from
Aug 11, 2021

Conversation

zhouzaida
Copy link
Collaborator

@zhouzaida zhouzaida commented Aug 8, 2021

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

Fix the bug that the training log and evaluating log are mixed.

Because the priority of EvalHook is higher than LoggerHook, the training log and the evaluating log are mixed. Therefore, we need to dump the training log and clear it before evaluating log is generated. In addition, this problem will only appear in IterBasedRunner whose self.by_epoch is False, because EpochBasedRunner whose self.by_epoch is True calls _do_evaluate in after_train_epoch stage, and at this stage the training log has been printed, so it will not cause any problem.

more details

Modification

Add some lines in mmcv/runner/hooks/evaluation.py

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 Aug 8, 2021

Codecov Report

Merging #1252 (2f934a8) into master (04daea4) will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1252      +/-   ##
==========================================
+ Coverage   68.27%   68.40%   +0.13%     
==========================================
  Files         160      160              
  Lines       10599    10608       +9     
  Branches     1937     1938       +1     
==========================================
+ Hits         7236     7256      +20     
+ Misses       2979     2976       -3     
+ Partials      384      376       -8     
Flag Coverage Δ
unittests 68.40% <100.00%> (+0.13%) ⬆️

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

Impacted Files Coverage Δ
mmcv/runner/hooks/evaluation.py 89.08% <100.00%> (+2.37%) ⬆️
mmcv/utils/parrots_wrapper.py 47.76% <0.00%> (-11.62%) ⬇️
mmcv/utils/env.py 56.36% <0.00%> (-0.25%) ⬇️
mmcv/version.py 82.35% <0.00%> (ø)
mmcv/ops/bbox.py 15.00% <0.00%> (ø)
mmcv/ops/info.py 61.90% <0.00%> (ø)
mmcv/onnx/info.py 68.75% <0.00%> (ø)
mmcv/image/misc.py 80.95% <0.00%> (ø)
mmcv/ops/carafe.py 23.30% <0.00%> (ø)
mmcv/ops/saconv.py 83.33% <0.00%> (ø)
... and 70 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04daea4...2f934a8. Read the comment docs.

@zhouzaida zhouzaida added the WIP label Aug 9, 2021
@zhouzaida zhouzaida removed the WIP label Aug 9, 2021
@zhouzaida zhouzaida changed the title [Fix] Fix the bug that the training log and evaluating log are mixed [WIP] Fix the bug that the training log and evaluating log are mixed Aug 11, 2021
@zhouzaida zhouzaida changed the title [WIP] Fix the bug that the training log and evaluating log are mixed [Fix] Fix the bug that the training log and evaluating log are mixed Aug 11, 2021
@ZwwWayne ZwwWayne merged commit 846d3a4 into open-mmlab:master Aug 11, 2021
@zhouzaida zhouzaida deleted the fix-log-bug branch August 11, 2021 14:43
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.

4 participants