Issue with exported spacy models

spacy
solved

#1

Hi,
Following the ‘First steps’, I created the model, and created the spacy package from it, then install the model and linked to custom name.
However, when trying to load with spacy.load(), or use it as a basis for ner.make-gold, I receive following error message (it depends on the language model used for training):
OSError: [E050] Can’t find model ‘en_core_web_lg.vectors’. It doesn’t seem to be a shortcut link, a Python package or a valid path to a data directory.
However, after loading the language model (in this case, the ‘en_core_web_lg’) before using my custom model, everything goes fine.
I am wondering if there is a way to create the spacy package model to use it without need to load the language model first.


(Ines Montani) #2

Hi! Could you share the meta.json of your custom model package? And which version of spaCy are you on? (You can find out by running the python -m spacy info command.)


(Piotr) #3

Hi Ines,

You were right, that was caused by wrong meta.json, which was generated after spacy package ... --create-meta, without vector names: "vectors":{ "width":XYZ, "vectors":XYZ, "keys":XYZ} . I compared that with meta.json automatically generated from prodigy textcat.batch-train ... en_core_web_md where vector info is stored in following format: "vectors":{... , "name":"en_core_web_md.vectors"}
I just copied automatically generated meta.json, changed model name to my unique and was able to load my custom model with vectors inside prodigy commands :slight_smile:

Spacy version: 2.0.16 - it looks like this is problem with spacy package --create-meta command
Prodigy version: 1.6.1


(Matthew Honnibal) #4

Thanks for following up! I think this points to an issue in spaCy, especially in the package command. We’ll get this fixed.