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

[Feature]Add loader args to config #1388

Merged
merged 6 commits into from
Apr 20, 2022

Conversation

VVsssssk
Copy link
Collaborator

@VVsssssk VVsssssk commented Apr 11, 2022

Motivation

Such a design only allows setting the different batch sizes in Val and test data loader.
Adding train_dataloader, val_dataloader, and test_dataloader in the data field of config allows more flexible usages.
A new example looks like below:

data = dict(
    train=dict(type='xxx', ...),
    val=dict(type='xxx', ...),
    test=dict(type='xxx', ...),
    # Use different batch size during inference.
    train_dataloader=dict(samples_per_gpu=64, workers_per_gpu=4),
    val_dataloader=dict(samples_per_gpu=8, workers_per_gpu=2),
    test_dataloader=dict(samples_per_gpu=8, workers_per_gpu=2),
)

This PR refers to MMDet PR #7668.

BC-breaking (Optional)

None

@VVsssssk VVsssssk requested a review from jshilong April 11, 2022 02:21
@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #1388 (63211c0) into master (c20b6cb) will increase coverage by 0.10%.
The diff coverage is 79.16%.

❗ Current head 63211c0 differs from pull request most recent head e068288. Consider uploading reports for the commit e068288 to get more accurate results

@@            Coverage Diff             @@
##           master    #1388      +/-   ##
==========================================
+ Coverage   51.20%   51.31%   +0.10%     
==========================================
  Files         212      213       +1     
  Lines       18280    18350      +70     
  Branches     2978     2996      +18     
==========================================
+ Hits         9361     9416      +55     
- Misses       8362     8371       +9     
- Partials      557      563       +6     
Flag Coverage Δ
unittests 51.31% <79.16%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
mmdet3d/utils/setup_env.py 68.00% <60.00%> (-4.73%) ⬇️
mmdet3d/utils/compat_cfg.py 80.30% <80.30%> (ø)
mmdet3d/utils/__init__.py 100.00% <100.00%> (ø)

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 c20b6cb...e068288. Read the comment docs.

@VVsssssk VVsssssk force-pushed the add_dataloader_args branch from 546ed62 to 7ab87ca Compare April 19, 2022 05:58
@VVsssssk VVsssssk changed the base branch from dev to master April 19, 2022 05:59
@ZwwWayne ZwwWayne merged commit ff159fe into open-mmlab:master Apr 20, 2022
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.

2 participants