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 register torchvision.transforms error #1956

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/efficientnet_v2/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Collections:
Title: "EfficientNetV2: Smaller Models and Faster Training"
README: configs/efficientnet_v2/README.md
Code:
URL: https://github.com/open-mmlab/mmpretrain/blob/main/mmpretrain/models/backbones/beit.py
URL: https://github.com/open-mmlab/mmpretrain/blob/main/mmpretrain/models/backbones/efficientnet_v2.py
Version: v1.0.0rc4

Models:
Expand Down
5 changes: 2 additions & 3 deletions mmpretrain/datasets/transforms/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ def register_vision_transforms() -> List[str]:
_transform = getattr(torchvision.transforms, module_name)
if inspect.isclass(_transform) and callable(
_transform) and not isinstance(_transform, (EnumMeta)):
from functools import partial
TRANSFORMS.register_module(
module=partial(
TorchVisonTransformWrapper, transform=_transform),
module=lambda name=module_name: TorchVisonTransformWrapper(
transform=torchvision.transforms[name], name=name),
name=f'torchvision/{module_name}')
vision_transforms.append(f'torchvision/{module_name}')
return vision_transforms
Expand Down