Loading ViT Adapter Model with Classification Head


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).

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:

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.