lukemelas / PyTorch-Pretrained-ViT

Vision Transformer (ViT) in PyTorch
770 stars 124 forks source link

Cannot load representation layer #6

Open arkel23 opened 3 years ago

arkel23 commented 3 years ago

I was trying to load the whole model with pretrained=True and representation layer = True but I get an error Further inspection by looking at the keys of the state_dict in your config.py file I noticed that there's no such weights in the state_dict for any of the models. It jumps from the transformer weights to a norm layer weights then to the fc weights. It skips the pre_logits.weight. I noticed in your Jupyter notebook it seems to be working correctly. Got any idea what could be wrong?