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

Add runner type #118

Merged
merged 20 commits into from
Oct 25, 2020
Merged

Add runner type #118

merged 20 commits into from
Oct 25, 2020

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Sep 9, 2020

This P.R. uses mmcv's build_runner in order to allow to select between EpochBasedRunner and IterBasedRunner. Defaults to IterBasedRunner in order to maintain the original behaviour.

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Sep 9, 2020

Codecov Report

Merging #118 into master will decrease coverage by 0.04%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #118      +/-   ##
==========================================
- Coverage   83.32%   83.27%   -0.05%     
==========================================
  Files          83       83              
  Lines        3921     3947      +26     
  Branches      617      623       +6     
==========================================
+ Hits         3267     3287      +20     
- Misses        520      524       +4     
- Partials      134      136       +2     
Flag Coverage Δ
#unittests 83.27% <76.92%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
mmseg/apis/train.py 25.00% <25.00%> (-0.65%) ⬇️
mmseg/datasets/custom.py 85.88% <75.00%> (-0.99%) ⬇️
mmseg/core/evaluation/eval_hooks.py 89.47% <95.23%> (+12.55%) ⬆️
mmseg/__init__.py 73.68% <100.00%> (ø)
mmseg/version.py 58.33% <100.00%> (ø)
mmseg/datasets/pipelines/transforms.py 96.28% <0.00%> (-1.24%) ⬇️

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 f86c24d...65a53e4. Read the comment docs.

tools/train.py Outdated Show resolved Hide resolved
@daavoo daavoo marked this pull request as draft September 15, 2020 16:23
@daavoo daavoo marked this pull request as ready for review September 28, 2020 19:09
@daavoo

This comment has been minimized.

logger=logger,
meta=meta)
runner = build_runner(
cfg.runner,
Copy link
Member

Choose a reason for hiding this comment

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

This breaks the backward compatibility. It should be better to keep the original api and add a deprecation warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not sure about how to maintain the backward compatibility so I create a default runner section that reproduces the old behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently, if the user is using an old config file, there will be error since max_iters is not specified.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We may keep the backward compatibility so that user may use old config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the block added above:

    if cfg.get('runner') is None:
        cfg.runner = {'type': 'IterBasedRunner', 'max_iters': cfg.total_iters}
        warnings.warn(
            'config is now expected to have a `runner` section, '
            'please set `runner` in your config.', DeprecationWarning)

User should be able to use an old config file, right?

@daavoo daavoo requested a review from hellock September 30, 2020 05:45
@hellock
Copy link
Member

hellock commented Oct 12, 2020

open-mmlab/mmpretrain#54

@hellock
Copy link
Member

hellock commented Oct 21, 2020

LGTM. @xvjiarui may take a pass.

@xvjiarui xvjiarui merged commit e384ef5 into open-mmlab:master Oct 25, 2020
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* Add runner_type option

* pre-commit

* Fix max_iters

* Add by_epoch to EvalHook

* Add test_eval_hook for epoch runner

* Remove runner-type arg from tools/train

* Add missing every_n_iters check for epoch mode

* Bump mmcv min version

* Use build_runner

* Use interval in tests

* Update test_eval_hook.py

* Use every_n_epochs instead of every_n_iters. Update DistEvalHook

* Add test_dist_eval_hook_epoch

* Fix tests

* Add DeprecationWarning

* Update docs

* Replace DeprecationWarning with UserWarning
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
final fixes before release
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
* init changelog

* update

* update

* update

* update

* update

* update
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