Skip to content

[NOMERGE] classification reference with v1 tensor backend #6952

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

Merged
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
6 changes: 4 additions & 2 deletions references/classification/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def __init__(
augmix_severity=3,
random_erase_prob=0.0,
):
trans = [transforms.RandomResizedCrop(crop_size, interpolation=interpolation)]
trans = [
transforms.PILToTensor(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't move the ConvertImageDtype transform here, because AA in v1 only supports uint8 inputs. Are we benchmarking v2 with float32 or uint8?

Copy link
Contributor

Choose a reason for hiding this comment

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

We are going to test both.

transforms.RandomResizedCrop(crop_size, interpolation=interpolation),
]
if hflip_prob > 0:
trans.append(transforms.RandomHorizontalFlip(hflip_prob))
if auto_augment_policy is not None:
Expand All @@ -32,7 +35,6 @@ def __init__(
trans.append(autoaugment.AutoAugment(policy=aa_policy, interpolation=interpolation))
trans.extend(
[
transforms.PILToTensor(),
transforms.ConvertImageDtype(torch.float),
transforms.Normalize(mean=mean, std=std),
]
Expand Down
1 change: 1 addition & 0 deletions references/classification/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def main(args):

utils.init_distributed_mode(args)
print(args)
print(torch.__version__, torch.version.cuda, torchvision.__version__)

device = torch.device(args.device)

Expand Down