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

[Enhance] Support reading gpu_collect from cfg.evaluation.gpu_collect #7672

Merged
merged 3 commits into from
May 8, 2022

Conversation

LutingWang
Copy link
Contributor

@LutingWang LutingWang commented Apr 8, 2022

Motivation

During testing, the cfg.evaluation.gpu_collect does not take effect. Rather, users need to specify gpu_collect from the command line.

This behavior is inconsistent with the evaluation during training, where cfg.evaluation.gpu_collect decides whether to use gpu_collect.

Modification

gpu_collect = args.gpu_collect or cfg.evaluation.gpu_collect in tools/test.py line 238-239

        outputs = multi_gpu_test(model, data_loader, args.tmpdir,
                                 args.gpu_collect)

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.

Reference

Issue #7495

tools/test.py Outdated
args.gpu_collect)
outputs = multi_gpu_test(
model, data_loader, args.tmpdir, args.gpu_collect
or cfg.evaluation.gpu_collect)
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if the cfg.evaluation.gpu_collect is not set? Will it cause error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it will. I'll fix it soon

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use args.gpu_collect or cfg.evaluation.get('gpu_collect', False) here.

tools/test.py Outdated Show resolved Hide resolved
@jbwang1997 jbwang1997 changed the base branch from master to dev April 20, 2022 02:17
@jbwang1997 jbwang1997 changed the title feat: read from cfg.evaluation.gpu_collect [Enhance] Support reading gpu_collect from cfg.evaluation.gpu_collect Apr 20, 2022
Copy link
Collaborator

@jbwang1997 jbwang1997 left a comment

Choose a reason for hiding this comment

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

LGTM

@ZwwWayne ZwwWayne merged commit 280cc7d into open-mmlab:dev May 8, 2022
ZwwWayne pushed a commit that referenced this pull request Jul 18, 2022
…ct (#7672)

* feat: read from cfg.evaluation.gpu_collect

* chore: yapf

* fix: gpu_collect not in config
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
…ct (open-mmlab#7672)

* feat: read from cfg.evaluation.gpu_collect

* chore: yapf

* fix: gpu_collect not in config
SakiRinn pushed a commit to SakiRinn/mmdetection-locount that referenced this pull request Mar 17, 2023
…ct (open-mmlab#7672)

* feat: read from cfg.evaluation.gpu_collect

* chore: yapf

* fix: gpu_collect not in config
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.

None yet

4 participants