# Loading ViT Adapter Model with Classification Head

**URL:** <https://discuss.huggingface.co/t/loading-vit-adapter-model-with-classification-head/53561>\
**Category:** 🤗Transformers\
**Created:** [September 5, 2023, 4:07am UTC](https://discuss.huggingface.co/t/loading-vit-adapter-model-with-classification-head/53561 "2023-09-05T04:07:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmoct](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@pmoct](https://discuss.huggingface.co/u/pmoct)\
**Post date:** [September 5, 2023, 4:07am UTC](https://discuss.huggingface.co/t/loading-vit-adapter-model-with-classification-head/53561/1 "2023-09-05T04:07:20Z")

</div>

Hello!

I have trained a ViT Adapter with a classification head added on, after following the instructions from the Adapter Training documentation page ([Adapter Training — AdapterHub documentation](https://docs.adapterhub.ml/training.html)).

However, I now want to use the model for predictions on new images, and so tried loading up the weights that were stored after training in the config.json file. I used this code to do so:

```auto
model = AutoAdapterModel.from_pretrained("path_to_config_file")

```

When I do this, however, I get the following warning:

> Some weights of the model checkpoint at path\_to\_config\_file were not used when initializing ViTAdapterModel

I believe this is because of an extra prediction head that I added to the base ViTAdapterModel during training, which was a step outlined by the documentation. However, the weights for this extra prediction head are not being used in the from\_pretrained call, as a normal, unmodified ViTAdapterModel is being initalized.

Is there a way to load my weights properly into the modified ViTAdapterModel?

I appreciate any advice.

---

<div class="post-metadata">

**Author:** ![antopost](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@antopost](https://discuss.huggingface.co/u/antopost)\
**Post date:** [July 2, 2024, 10:55am UTC](https://discuss.huggingface.co/t/loading-vit-adapter-model-with-classification-head/53561/2 "2024-07-02T10:55:19Z")

</div>

> [@pmoct](#):
>
> However, I now want to use the model for predictions on new images, and so tried loading up the weights that were stored after training in the config.json file. I used this code to do so:
> 
> ```auto
> model = AutoAdapterModel.from_pretrained("path_to_config_file")
> 
> ```
> 
> When I do this, however, I get the fo

Any developments on this?
