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 builder #570

Merged
merged 9 commits into from
Sep 25, 2020
Merged

Add runner builder #570

merged 9 commits into from
Sep 25, 2020

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Sep 21, 2020

This P.R. adds a new method build_runner and a new Registry object: RUNNERS for managing runner types.
This allows to specify runner type (and corresponding parameters) via configuration files.

The max_iters and max_epochs arguments have been moved from run to __init__ (this change is backwards compatible with deprecation warning).
I don't know if there was a use case that needed to have them in run but in all downstream repos (mmdet, mmseg, etc) those args were parsed from config so i think it makes sense to set them during instantiation.

Discussed in open-mmlab/mmsegmentation#118

@codecov
Copy link

codecov bot commented Sep 21, 2020

Codecov Report

Merging #570 into master will increase coverage by 0.21%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #570      +/-   ##
==========================================
+ Coverage   64.69%   64.91%   +0.21%     
==========================================
  Files         133      134       +1     
  Lines        7600     7616      +16     
  Branches     1338     1342       +4     
==========================================
+ Hits         4917     4944      +27     
+ Misses       2435     2422      -13     
- Partials      248      250       +2     
Flag Coverage Δ
#unittests 64.91% <63.63%> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
mmcv/runner/hooks/logger/mlflow.py 71.79% <ø> (ø)
mmcv/runner/hooks/logger/wandb.py 63.88% <ø> (ø)
mmcv/runner/iter_based_runner.py 25.36% <36.36%> (+7.93%) ⬆️
mmcv/runner/epoch_based_runner.py 79.04% <57.14%> (+5.51%) ⬆️
mmcv/cnn/bricks/wrappers.py 96.66% <100.00%> (ø)
mmcv/runner/__init__.py 100.00% <100.00%> (ø)
mmcv/runner/base_runner.py 70.67% <100.00%> (+0.28%) ⬆️
mmcv/runner/builder.py 100.00% <100.00%> (ø)
mmcv/version.py 92.30% <100.00%> (ø)
... and 2 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 5cad35b...0d00fe2. Read the comment docs.

@hellock hellock requested a review from ZwwWayne September 21, 2020 08:10
Copy link
Collaborator

@ZwwWayne ZwwWayne left a comment

Choose a reason for hiding this comment

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

The PR looks good to me.

@hellock hellock merged commit 6b52e9b into open-mmlab:master Sep 25, 2020
wxzs5 pushed a commit to wxzs5/mmcv that referenced this pull request Nov 20, 2020
* Add build_runner

* Parametrize test_runner

* Add imports to runner __init__

* Refactor max_iters and max_epochs from run to init

* Add assertion error messages

* Add test_builder

* Make change retro-compatible

* Raise ValueError if max_epochs and max_iters
mattdawkins added a commit to VIAME/mmcv that referenced this pull request Dec 3, 2020
* tag 'v1.1.5': (81 commits)
  bump version to 1.1.5 (open-mmlab#603)
  Fix wrappers version comparison (open-mmlab#602)
  revert dcn (open-mmlab#597)
  lint markdown files (open-mmlab#592)
  bump version to 1.1.4 (open-mmlab#591)
  fix lint open-mmlab#580 (open-mmlab#590)
  Fixed fp16_optimizer state bug (open-mmlab#580)
  register deconv in CONV_LAYERS (open-mmlab#582)
  [enhance]: show grad norm in fp16 optimizer hook (open-mmlab#584)
  [Enhance] Switch to https://download.openmmlab.com (open-mmlab#583)
  Support to specify LR of DCN's conv_offset (open-mmlab#344)
  add torchvision roi_align with aligned=True (open-mmlab#581)
  Add runner builder (open-mmlab#570)
  [fix]: fix wrapper comparison of pytorch version (open-mmlab#572)
  Add missing by_epoch arg (open-mmlab#576)
  merge the calling of train/val_step and batch_processor into run_iter (open-mmlab#553)
  bump version to 1.1.3 (open-mmlab#569)
  fix deprecated wrappers exiting bug (open-mmlab#567)
  add switch for onnx exporter (open-mmlab#564)
  fix dcon forward and backward bug (open-mmlab#565)
  ...
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.

3 participants