scenic icon indicating copy to clipboard operation
scenic copied to clipboard

ViT ImageNet Pretrained Model Problem with ViViT

Open pabdzadeh opened this issue 3 years ago • 9 comments

Hey,

I download the pretrained ImageNet21k ViT b_16 model from the urls mentioned in the configuration files, and replace the path in the config file, but for both scenic and bigvision versions I face some problems.

When I put the path to scenic pretrained version, it gives the following error: raise ValueError('No checkpoint for the pretrained model is found in: ' ValueError: No checkpoint for the pretrained model is found in: /content/ViT_B_16_ImageNet21k

When I put the path to bigvision pretrained version, this happens: File "/usr/local/lib/python3.7/dist-packages/scenic/train_lib/pretrain_utils.py", line 269, in convert_bigvision_to_scenic_checkpoint restored_params = tree['opt']['target'] KeyError: 'opt'

Can you please tell me what should I do?

Thanks in advance.

pabdzadeh avatar Dec 17 '21 09:12 pabdzadeh

** ** commented on 17 Dec 2021 Hi, I have the same question. Do you have the solution?

kar9999 avatar Mar 14 '22 19:03 kar9999

We'll look into this soon and send a fix, but in the meantime, I think replacing restored_params = tree['opt']['target'] with restored_params = tree['target'] would solve the issue.

MostafaDehghani avatar Mar 15 '22 17:03 MostafaDehghani

We'll look into this soon and send a fix, but in the meantime, I think replacing restored_params = tree['opt']['target'] with restored_params = tree['target'] would solve the issue.

Thanks for your answer. When I choose bigvision version, I download it through https://storage.googleapis.com/vit_models/imagenet21k/ViT-B_16.npz Then this happens restored_params = tree['opt']['target'] KeyError: 'opt' Then I replacing restored_params = tree['opt']['target'] with restored_params = tree['target'] . Another problem comes. restored_params = tree['target'] KeyError: 'target'

kar9999 avatar Mar 16 '22 13:03 kar9999

We'll look into this soon and send a fix, but in the meantime, I think replacing restored_params = tree['opt']['target'] with restored_params = tree['target'] would solve the issue.

Thanks for your answer. When I choose bigvision version, I download it through https://storage.googleapis.com/vit_models/imagenet21k/ViT-B_16.npz Then this happens restored_params = tree['opt']['target'] KeyError: 'opt' Then I replacing restored_params = tree['opt']['target'] with restored_params = tree['target'] . Another problem comes. restored_params = tree['target'] KeyError: 'target'

Have the same issue, which version of the model should I use? Which one works? tree has these attributes only ['Transformer', 'cls', 'embedding', 'head', 'pre_logits']

gurinvlad45 avatar Aug 11 '22 17:08 gurinvlad45

I have a similar issue, have you known that which version of the model works?

StonePanda avatar Nov 23 '22 04:11 StonePanda

I have a similar issue

FancyL1999 avatar Nov 24 '22 14:11 FancyL1999

did anyone find a solution?

Mohamedellebody avatar Feb 04 '23 13:02 Mohamedellebody

@MostafaDehghani

Mohamedellebody avatar Feb 04 '23 13:02 Mohamedellebody

I am facing similar issues. Can someone help me, What should I do, or What should I be looking at?

What do those "opt" and "target" refer to? Because I could not find those key-value pairs in the pre-train weight downloaded from

https://console.cloud.google.com/storage/browser/vit_models/augreg/

scenic_pretraiin_utils_problem scenic_pretraiin_utils_problem_2 scenic_pretraiin_utils_problem3

ashimGelal avatar Nov 04 '23 16:11 ashimGelal