pytorch-image-models icon indicating copy to clipboard operation
pytorch-image-models copied to clipboard

[BUG] ViT ImageNet1K weights

Open hellojialee opened this issue 2 years ago • 2 comments

Describe the bug In Version: 0.5.4 for example, dose vit_tiny_patch16_224 means vit_tiny trained from scratch on ImageNet1K? However, in the current Version 0.6, vit_tiny_patch16_224 means vit_tiny pretrained on 21k and then fine-tuned on in1k, which is very misleading and leading to errors for down-stream experiments.

To Reproduce Steps to reproduce the behavior: https://github.com/rwightman/pytorch-image-models/blob/18ec173f95aa220af753358bf860b16b6691edb2/timm/models/vision_transformer.py#L642

Expected behavior Regular ImageNet-1K training without extra data knowledge.

hellojialee avatar Dec 23 '22 03:12 hellojialee

@hellojialee with the new multi-weight support it's easy to add the old weights back, but I'm not sure there was ever tiny w/o 21k pretrain in timm. I don't think the original google release included the 1k ones, but I'd have to check. If there are specific weights you'd like added under new tags please mention here...

rwightman avatar Dec 23 '22 04:12 rwightman

There are definitely some augreg (how to train your vit) 1k tiny weights but I never them in any timm release.

EDIT yes, the original ViT release in JAX never had any Tiny weights. There were some deit tiny on 1k in here https://github.com/rwightman/pytorch-image-models/blob/main/timm/models/deit.py

The vit_tiny that were there before I added multi-weight support and tagged them with better names were the same 21k pretrain, ft on 1k ones (look at the URL, it's pretty descriptive as to what they are). I never added the 1k only train, but could add them easily now.

rwightman avatar Dec 23 '22 04:12 rwightman