Cannot run prodigy ner.teach after update

Hi,

After installing the update you sent out four days ago I am unable to run prodigy, despite using the exact command on the exact same dataset and training data that was working before the update. I get the following error messages:

$ prodigy ner.teach engelsk_model en_core_web_sm traindata.txt --label ORG

Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/prodigy/main.py”, line 235, in
controller = recipe(args, use_plac=True)
File “cython_src/prodigy/core.pyx”, line 129, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/plac_core.py”, line 328, in call
cmd, result = parser.consume(arglist)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/plac_core.py”, line 207, in consume
return cmd, self.func(
(args + varargs + extraopts), **kwargs)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/prodigy/recipes/ner.py”, line 53, in teach
model = EntityRecognizer(spacy.load(spacy_model), label=label)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/init.py”, line 15, in load
return util.load_model(name, **overrides)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 104, in load_model
return load_model_from_link(name, **overrides)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 123, in load_model_from_link
return cls.load(**overrides)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/data/en_core_web_sm/init.py”, line 12, in load
return load_model_from_init_py(file, **overrides)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 156, in load_model_from_init_py
return load_model_from_path(data_path, meta, **overrides)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 139, in load_model_from_path
return nlp.from_disk(model_path)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/language.py”, line 540, in from_disk
util.from_disk(path, deserializers, exclude)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 486, in from_disk
reader(path / key)
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/language.py”, line 536, in
deserializers[proc.name] = lambda p, proc=proc: proc.from_disk(p, vocab=False)
File “pipeline.pyx”, line 205, in spacy.pipeline.BaseThincComponent.from_disk
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/spacy/util.py”, line 486, in from_disk
reader(path / key)
File “pipeline.pyx”, line 198, in spacy.pipeline.BaseThincComponent.from_disk.load_model
File “/home/mede/Desktop/_OVERFOERES/CluedIn/NER_extraction/spacyNER/prodigy_installation/virtualenv_prodigy/lib/python3.5/site-packages/thinc/neural/_classes/model.py”, line 351, in from_bytes
dest = getattr(layer, name)
AttributeError: ‘FeedForward’ object has no attribute ‘G’

I have no idea what this means or how to fix it. Any help you might be able to provide would be greatly appreciated.

Hi,

We haven’t found a way to make that error nicer yet, so sorry it’s so cryptic. You probably need to run:

spacy download en_core_web_sm --force

This sort of error means that the weights being read from disk don’t match the architecture defined in the code. My guess is that the mode being loaded is one of our pre-trained ones. The command above would redownload it, and force the overwrite.

If you’re trying to load a model you previously trained yourself, you’ll have to retrain it.

Regrettably the same situation is likely to occur again on the next version. The models for spaCy 2 are improving very quickly, and we’re trying to find the best balance of speed and accuracy. The good news is that results are really good — and we’re getting very close to the spaCy 2 release candidate, after which things will be more stable.

1 Like