# Unable to load a trained model

**URL:** <https://discuss.huggingface.co/t/unable-to-load-a-trained-model/33988>\
**Category:** 🤗Transformers\
**Created:** [March 17, 2023, 5:03am UTC](https://discuss.huggingface.co/t/unable-to-load-a-trained-model/33988 "2023-03-17T05:03:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RahulChittimalla](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@RahulChittimalla](https://discuss.huggingface.co/u/RahulChittimalla)\
**Post date:** [March 17, 2023, 5:03am UTC](https://discuss.huggingface.co/t/unable-to-load-a-trained-model/33988/1 "2023-03-17T05:03:38Z")

</div>

Hi,  
I’m unable to load a Bert classifier model that is trained on a custom dataset. But using pipeline I’m unable to load the model.

`model = pipeline("text-classification", model="path-to-trained-model")`

Error:

> ValueError: Could not load model [model] with any of the following classes: (\<class ‘transformers.models.auto.modeling\_auto.AutoModelForSequenceClassification’\>, \<class ‘transformers.models.bert.modeling\_bert.BertForSequenceClassification’\>).
