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

timm data loader for the ViT models #5

Open
yatsurama opened this issue Nov 16, 2021 · 0 comments
Open

timm data loader for the ViT models #5

yatsurama opened this issue Nov 16, 2021 · 0 comments

Comments

@yatsurama
Copy link

Thanks a lot for your interesting work!

If I see it correctly, the script white_box_test.py uses data loader defined in the function white_box_test.get_val_loader for the ViT models obtained from timm. It uses default ImageNet values mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225].

It seems that timm documentation suggests a different set of transforms for data preprocessing:
https://rwightman.github.io/pytorch-image-models/models/vision-transformer/

The difference seems to be that it rescales the images to the size of 248 and uses mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5] for normalization.

When I use their input transform I obtain larger clean accuracy for transformer models than the one provided in the paper. It looks similar to the one provided in the paperswithcode page:
https://paperswithcode.com/lib/timm/vision-transformer

Perhaps adding the transforms from the timm package to the code could help in evaluation.

Thanks!

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

No branches or pull requests

1 participant