# Uninitiallized weights with supposed correct architecture

**URL:** <https://discuss.huggingface.co/t/uninitiallized-weights-with-supposed-correct-architecture/57641>\
**Category:** Models\
**Created:** [October 6, 2023, 3:39pm UTC](https://discuss.huggingface.co/t/uninitiallized-weights-with-supposed-correct-architecture/57641 "2023-10-06T15:39:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vabatista](https://avatars.discourse-cdn.com/v4/letter/v/47e85d/32.png) [@vabatista](https://discuss.huggingface.co/u/vabatista)\
**Post date:** [October 6, 2023, 3:39pm UTC](https://discuss.huggingface.co/t/uninitiallized-weights-with-supposed-correct-architecture/57641/1 "2023-10-06T15:39:48Z")

</div>

Why when running this code below (with any squad model),

```auto
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("mrm8488/spanbert-finetuned-squadv2")
model = AutoModelForQuestionAnswering.from_pretrained("mrm8488/spanbert-finetuned-squadv2")

```

I receive this warning?

```auto
Some weights of the model checkpoint at mrm8488/spanbert-finetuned-squadv1 were not used when initializing BertForQuestionAnswering: ['bert.pooler.dense.bias', 'bert.pooler.dense.weight']
- This IS expected if you are initializing BertForQuestionAnswering from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertForQuestionAnswering from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).

```

---

<div class="post-metadata">

**Author:** ![Sandy1857](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@Sandy1857](https://discuss.huggingface.co/u/Sandy1857)\
**Post date:** [October 6, 2023, 7:28pm UTC](https://discuss.huggingface.co/t/uninitiallized-weights-with-supposed-correct-architecture/57641/2 "2023-10-06T19:28:39Z")

</div>

This is just a warning and is normal. You’ll find this warning with other models as well.

What it indicates is that if you are loading a model from a checkpoint for further fine-tuning on a similar task, this warning should not occur.

But say, you load a model say Bert from its pre-training checkpoint on a different task, for e.g. sequence classification, this warning is normal.
