# Problem loading trained model in prodiga to spacy.

**URL:** https://support.prodi.gy/t/problem-loading-trained-model-in-prodiga-to-spacy/4161
**Category:** Uncategorized
**Tags:** solved, spacy, ner
**Created:** [April 22, 2021, 2:00am UTC](https://support.prodi.gy/t/problem-loading-trained-model-in-prodiga-to-spacy/4161 "2021-04-22T02:00:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alejandroarancibia07](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alejandroarancibia07](https://support.prodi.gy/u/alejandroarancibia07)
#### Post date: [April 22, 2021, 2:00am UTC](https://support.prodi.gy/t/problem-loading-trained-model-in-prodiga-to-spacy/4161/1 "2021-04-22T02:00:54Z")

</div>

Hi, noob person over here, thanks for having me. I'm having problems loading my model to spacy, I trained it and save it --output to the folder of my project. But when I try to load it I get this error "OSError: [E053] Could not read config.cfg from ner\_bci\_apolo/config.cfg" I'm trying to load with:

import ner\_bci\_apolo  
nlp = spacy.load('ner\_bci\_apolo')  
triple check that the file does exist in the folder, try relativo and absolute path, and nothing. The model was trained using ner.teach with almost 300 annotated cases. I used a virtual environment, but when I run the script from Anaconda I'm loading the model not from that venv (does that make any sense? I'm a noob), I run anaconda using Python 3.9 and the venv is in 3.7.  
I'm los getting this message:  
/Users/alejandroarancibia/opt/anaconda3/lib/python3.7/site-packages/spacy/util.py:707: UserWarning: [W095] Model 'es\_core\_news\_sm' (2.3.1) requires spaCy \>=2.3.0,\<2.4.0 and is incompatible with the current version (3.0.5). This may lead to unexpected results or runtime errors. To resolve this, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate  
warnings.warn(warn\_msg)  
Traceback (most recent call last):

============================== ✨ Prodigy Stats ==============================

Version 1.10.7  
Location /Users/alejandroarancibia/Desktop/NLP\_BNI/venv/lib/python3.7/site-packages/prodigy  
Prodigy Home /Users/alejandroarancibia/.prodigy  
Platform Darwin-17.7.0-x86\_64-i386-64bit  
Python Version 3.7.4  
Database Name SQLite  
Database Id sqlite  
Total Datasets 1  
Total Sessions 14  
============================== Info about spaCy ==============================

spaCy version 2.3.5  
Location /Users/alejandroarancibia/opt/anaconda3/lib/python3.7/site-packages/spacy  
Platform Darwin-17.7.0-x86\_64-i386-64bit  
Python version 3.7.9  
Models

Help please!! Thanks and congrats on this great community.

---

<div class="post-metadata">

### Author: ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)
#### Post date: [April 22, 2021, 7:17am UTC](https://support.prodi.gy/t/problem-loading-trained-model-in-prodiga-to-spacy/4161/2 "2021-04-22T07:17:38Z")

</div>

Hi and thanks! 😊

From the error message you posted, it sounds like the `spacy` you're using to load the model is spaCy v3, specifically spaCy 3.0.5. However, the model was trained with spaCy v2, so it's incompatible.

It's definitely very confusing, though, because if you compare the paths to the spaCy installation in your anaconda environment, it's the same 🤔 `/Users/alejandroarancibia/opt/anaconda3/lib/python3.7/site-packages/spacy/` Typically, the most common explanation for problems like this is that there are two different environments with different packages installed – but this doesn't seem to be the case here. Did you install or change anything between trying to load the model and printing the output of `spacy info`?

---

<div class="post-metadata">

### Author: ![alejandroarancibia07](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alejandroarancibia07](https://support.prodi.gy/u/alejandroarancibia07)
#### Post date: [April 22, 2021, 12:35pm UTC](https://support.prodi.gy/t/problem-loading-trained-model-in-prodiga-to-spacy/4161/3 "2021-04-22T12:35:12Z")

</div>

Thaks for the quik reply Ines. I was able to make it work, runing the script from the same environment whre the model was trained. So I`m all set up now.
