question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using spacy CLI train command

See original GitHub issue

I tried to train a tagger and parser using the spacy CLI train command:

python -m spacy train <lang> . <lang>-train.json --no-ner

The script breaks at the end of the training; here is the output:

Itn.	N weight	N feats	UAS	NER F.	Tag %	Token %
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1455/1455 [01:11<00:00, 20.37it/s]
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/ubuntu/spaCy/spacy/__main__.py", line 133, in <module>
    plac.Interpreter.call(CLI)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 1142, in call
    print(out)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 914, in __exit__
    self.close(exctype, exc, tb)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 952, in close
    self._interpreter.throw(exctype, exc, tb)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 964, in _make_interpreter
    arglist = yield task
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 1139, in call
    raise_(task.etype, task.exc, task.tb)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 380, in _wrap
    for value in genobj:
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 95, in gen_exc
    raise_(etype, exc, tb)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_ext.py", line 966, in _make_interpreter
    cmd, result = self.parser.consume(arglist)
  File "/home/ubuntu/spaCy/.env/local/lib/python2.7/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/home/ubuntu/spaCy/spacy/__main__.py", line 95, in train
    not no_parser, not no_ner, parser_L1)
  File "/home/ubuntu/spaCy/spacy/cli/train.py", line 39, in train
    entity_cfg, n_iter)
  File "/home/ubuntu/spaCy/spacy/cli/train.py", line 68, in train_model
    **dev_scores.scores)
AttributeError: 'list' object has no attribute 'scores'

My current environment is:

    Info about spaCy

    Python version     2.7.12         
    Platform           Linux-4.4.0 Ubuntu-16.04
    spaCy version      1.8.0          
    Installed models                   
    Location           /home/ubuntu/spaCy/spacy

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
inescommented, Jun 5, 2017

This is finally fixed in v2.0.0 alpha!

1reaction
honnibalcommented, Apr 23, 2017

Sorry this was my fault. Try again? Just made another tweak.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Interface Β· spaCy API Documentation
spaCy's CLI provides a range of helpful commands for downloading and training pipelines, converting data and debugging your config, data and installation.
Read more >
python - Spacy 3.1 - KeyError: 'train' using spacy train command
This error happens because spaCy looks for the [train] block in the config but there's no such thing.
Read more >
Unable to use Prodigy annotations with SpaCy CLI train - usage
But when I try to use the same annotation dataset (exported using ner.gold-to-spacy) with the cli "train" command I get the following error....
Read more >
7. How to Train spaCy NER Model
In this simple, toy example, we are going to do (intentionally) a major mistake in ML. We are going to use not only...
Read more >
Training and integrating a custom text classifier to a spacy ...
sentences error: [E030] Sentence boundaries unset. You can add the 'sentencizer' component to the pipeline with: `nlp.add_pipe('sentencizer')`. Alternatively,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found