# Saved fine-tuned model doesn't work after loading it

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaved-fine-tuned-model-doesnt-work-after-loading-it%2F26283%3E%5C
**Category:** 🤗Transformers\
**Created:** [November 18, 2022, 12:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaved-fine-tuned-model-doesnt-work-after-loading-it%2F26283 "2022-11-18T00:05:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SergiiGurbych](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sergiigurbych/32/12448_2.png) [@SergiiGurbych](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSergiiGurbych)%5C
**Post date:** [November 18, 2022, 12:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaved-fine-tuned-model-doesnt-work-after-loading-it%2F26283%2F1 "2022-11-18T00:05:48Z")

</div>

Hi, guys!  
I am fine-tuning a language model (“youscan/ukr-roberta-base”) and after fine-tuning it works properly and predicts perfectly. I save it with model.save(‘name’) to Google Colab and then move it to Google Drive. When I load it the next time with

model = tf.keras.models.load\_model(‘./drive/MyDrive/place’)

and try to do the same .predict() as previously, I get error:

“ValueError: Exception encountered when calling layer” tf\_roberta\_for\_sequence\_classification\_2" (type TFRobertaForSequenceClassification).  
Could not find matching concrete function to call loaded from the SavedModel".

What is wrong here?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [November 18, 2022, 8:16am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaved-fine-tuned-model-doesnt-work-after-loading-it%2F26283%2F2 "2022-11-18T08:16:33Z")

</div>

Hi,

It’s recommended to use `save_pretrained` and `from_pretrained`

---

<div class="post-metadata">

**Author:** ![SergiiGurbych](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sergiigurbych/32/12448_2.png) [@SergiiGurbych](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSergiiGurbych)%5C
**Post date:** [November 18, 2022, 6:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaved-fine-tuned-model-doesnt-work-after-loading-it%2F26283%2F3 "2022-11-18T18:57:59Z")

</div>

Thank you!
