# Error while loading the checkpoints

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-while-loading-the-checkpoints%2F10644%3E%5C
**Category:** Models\
**Created:** [October 9, 2021, 2:52pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-while-loading-the-checkpoints%2F10644 "2021-10-09T14:52:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuhammadRehman](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MuhammadRehman](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMuhammadRehman)%5C
**Post date:** [October 9, 2021, 2:52pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-while-loading-the-checkpoints%2F10644%2F1 "2021-10-09T14:52:28Z")

</div>

I finetuned the Xlm/roberta and got its .ckpt file. But I am unable to load these check points for testing. While loading, I am getting errors like this:  
‘XLMRobertaModel’ object has no attribute ‘load\_from\_checkpoint.’

I am using this code to load the checkpoint.

from transformers import AutoTokenizer  
model\_checkpoint = ‘deepset/xlm-roberta-base-squad2’  
tokenizer = AutoTokenizer.from\_pretrained(model\_checkpoint)

from transformers import AutoModelForQuestionAnswering  
model = AutoModelForQuestionAnswering.from\_pretrained(model\_checkpoint)

chk\_pth="/content/drive/MyDrive/Russian-QA/epoch=18-step=53826.ckpt"  
model2=model.load\_from\_checkpoint(chk\_pth)

kindly help me to sort out the slolution

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [October 11, 2021, 2:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-while-loading-the-checkpoints%2F10644%2F2 "2021-10-11T14:17:05Z")

</div>

I’m not sure where you have seen the `load_from_checkpoint` method but it does not exist in Transformers. Same for the `.ckpt` file, it’s not something generated from our side.
