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] Update torchvision transform wrapper #1595

Merged
merged 3 commits into from
May 26, 2023
Merged

Conversation

mzr1996
Copy link
Member

@mzr1996 mzr1996 commented May 25, 2023

Motivation

The original implementation of torchvision transforms wrapper will create some new classes dynamically. And
these behaviors may cause multi-process workers broken in the dataloader.

Modification

Use function registry instead of new class to register these torchvision transformers.

BC-breaking (Optional)

This modification required the latest mmengine(>=0.7.3)

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • CLA has been signed and all committers have signed the CLA in this PR.

@mzr1996 mzr1996 requested a review from Ezra-Yu May 25, 2023 03:37
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Patch coverage: 15.44% and project coverage change: -1.04 ⚠️

Comparison is base (f9dcae2) 68.16% compared to head (6788c27) 67.13%.

❗ Current head 6788c27 differs from pull request most recent head f60a765. Consider uploading reports for the commit f60a765 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1595      +/-   ##
==========================================
- Coverage   68.16%   67.13%   -1.04%     
==========================================
  Files         295      303       +8     
  Lines       23372    23843     +471     
  Branches     3713     3777      +64     
==========================================
+ Hits        15932    16007      +75     
- Misses       6880     7273     +393     
- Partials      560      563       +3     
Flag Coverage Δ
unittests 67.13% <15.44%> (-1.04%) ⬇️

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

Impacted Files Coverage Δ
mmpretrain/datasets/__init__.py 70.27% <0.00%> (-4.02%) ⬇️
mmpretrain/datasets/gqa_dataset.py 0.00% <0.00%> (ø)
mmpretrain/datasets/nocaps.py 0.00% <0.00%> (ø)
mmpretrain/datasets/scienceqa.py 0.00% <ø> (ø)
mmpretrain/models/multimodal/__init__.py 40.00% <0.00%> (-4.45%) ⬇️
...retrain/models/multimodal/chinese_clip/__init__.py 0.00% <0.00%> (ø)
mmpretrain/models/multimodal/chinese_clip/bert.py 0.00% <0.00%> (ø)
...ain/models/multimodal/chinese_clip/chinese_clip.py 0.00% <0.00%> (ø)
mmpretrain/models/multimodal/chinese_clip/utils.py 0.00% <0.00%> (ø)
mmpretrain/models/utils/__init__.py 83.33% <0.00%> (ø)
... and 12 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

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

LGTM.

@mzr1996 mzr1996 merged commit 5bd088e into open-mmlab:dev May 26, 2023
5 of 6 checks passed
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

2 participants