# Error while loading the custom Text classification model in python

**URL:** https://support.prodi.gy/t/error-while-loading-the-custom-text-classification-model-in-python/1674
**Category:** Uncategorized
**Tags:** spacy, textcat
**Created:** [June 18, 2019, 1:56pm UTC](https://support.prodi.gy/t/error-while-loading-the-custom-text-classification-model-in-python/1674 "2019-06-18T13:56:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aman7ronaldo](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@aman7ronaldo](https://support.prodi.gy/u/aman7ronaldo)
#### Post date: [June 18, 2019, 1:56pm UTC](https://support.prodi.gy/t/error-while-loading-the-custom-text-classification-model-in-python/1674/1 "2019-06-18T13:56:20Z")

</div>

Hi,  
I am facing an error while loading the custom text model which i have created.  
The custom model is annotated using textcat.manual command.

I have followed the necessary steps to create the package of the custom model and have successfully installed it.

Now, while loading the model in python using Spacy commands , it is throwing the following error.

'FeedForward' object has no attribute 'W'

I have found a thread which talks about a similar issue.

> [@Load error after adding custom textcat model to the pipeline](https://support.prodi.gy/t/load-error-after-adding-custom-textcat-model-to-the-pipeline/122):
>
> Sorry if this is more a spacy question than prodigy… i am trying to add a custom textcat model to the pipeline and save / load the resulting pipeline. Using the spacy example/train\_textcat.py and the original textcat model as a basis, i changed lines 38+ in train\_textcat.py from textcat = nlp.create\_pipe('textcat') nlp.add\_pipe(textcat, last=True) to textcat = MyTextCategorizer(nlp.vocab) nlp.add\_pipe(textcat, last=True) with MyTextCategorizer for now being: class MyTextCa…

How to deal with this issue?

---

<div class="post-metadata">

### Author: ![honnibal](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/honnibal/32/35_2.png) [@honnibal](https://support.prodi.gy/u/honnibal)
#### Post date: [June 20, 2019, 9:41pm UTC](https://support.prodi.gy/t/error-while-loading-the-custom-text-classification-model-in-python/1674/2 "2019-06-20T21:41:37Z")

</div>

This is possibly a dumb question, but: have you made sure that you’re loading the textcat model back with the same version as the one in your Prodigy installation? The model architecture isn’t necessarily compatible across versions.

If the spaCy versions match, could you paste the contents of the `cfg` file within the textcat model directory?
