ner.teach returning argument 'beam' incorrect type

while trying to ner.teach on my own data.jsonl I’m getting a weird error

Traceback (most recent call last):
  File "/usr/lib/python3.5/", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/prodigy/lib/python3.5/site-packages/prodigy/", line 235, in <module>
    controller = recipe(*args, use_plac=True)
  File "cython_src/prodigy/core.pyx", line 143, in prodigy.core.recipe.recipe_decorator.recipe_proxy
  File "cython_src/prodigy/util.pyx", line 173, in prodigy.util.suggest_view_id
  File "/home/ubuntu/prodigy/lib/python3.5/site-packages/toolz/", line 368, in first
    return next(iter(seq))
  File "cython_src/prodigy/components/sorters.pyx", line 127, in __iter__
  File "cython_src/prodigy/components/sorters.pyx", line 53, in genexpr
  File "cython_src/prodigy/models/ner.pyx", line 215, in __call__
  File "cython_src/prodigy/models/ner.pyx", line 185, in get_tasks
  File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
  File "cython_src/prodigy/models/ner.pyx", line 155, in predict_spans
  File "cython_src/prodigy/models/ner.pyx", line 54, in prodigy.models.ner._BatchBeam.__init__
TypeError: Argument 'beam' has incorrect type (expected, got list)

using the command

prodigy ner.teach testing en_core_web_sm /home/ubuntu/my_data.jsonl

on my ubuntu 16.04 python 3.5.2 and spacyv2.0.0

Thanks for the report – and sorry about the bug!

To help us debug this, could you run spacy validate in your Prodigy environment and check if the models you’re using are up to date and compatible with the version of spaCy that’s installed? This can often be a cause of errors within the model code.

If not, could you post a sample of your data (or something similar) so we can try and reproduce the error?

1 Like

I ran the validation command, and it’s a valid version. The data I’m using is just for testing. Simply the data posted on prodigy’s tutorial, about the github titles.
Thank you for the fast reply,
best regards.

Update: Turns out that this was a bug in spaCy, that’s fixed in the latest version. We’re just preparing an update of Prodigy that’s compatible with the latest spaCy v2.0.

1 Like

Okay, now it’s working with the new update. Thank you.

1 Like

I am facing the same issue with below spacy configurations.

Installed models (spaCy v2.0.5)

TYPE        NAME                  MODEL                 VERSION
package     en-core-web-sm        en_core_web_sm        2.0.0    ✔
link        en_core_web_sm        en_core_web_sm        2.0.0    ✔

OS: Ubuntu

This works in my local which is windows machine with Spacy version 2.3.0. But it fails in Ubuntu machine with above versions. Is there any fix with Spacy 2.0.5 version?

@pavanivippala We do backport some bug fixes, but unfortunately we weren't able to port back this fix, and we're no longer making releases on the v2.0.x line.