Spacy: Errors in spaCy train init cli [spacy-nightly]

Created on 3 Nov 2020  ·  3Comments  ·  Source: explosion/spaCy

I've run into a couple of bugs when using the new spacy train init CLI

1: Using init-fill on a config file downloaded from the quickstart widget produces an error:

python -m spacy init fill-config base_config.cfg config.cfg

✘ Can't construct config: calling registry function
(build_text_classifier) failed
spacy.TextCatEnsemble.v1   build_text_classifier() missing 2 required positional arguments: 'pretrained_vectors' and 'dropout'

{'model': {'@architectures': 'spacy.TextCatEnsemble.v1', 'exclusive_classes': False, 'width': 64, 'conv_depth': 2, 'embed_size': 2000, 'window_size': 1, 'ngram_size': 1, 'nO': None}}

Here's what I put into the widget:

Here's the base config file I downloaded from the widget (added .txt so GitHub would accept the upload)
base_config.cfg.txt

However, creating this config locally from scratch works fine:

python -m spacy init config -p textcat -l en --optimize accuracy --cpu  config.cfg
ℹ Generated template specific for your use case
- Language: en
- Pipeline: textcat
- Optimize for: accuracy
- Hardware: CPU
- Transformer: False
✔ Auto-filled config with all values
✔ Saved config
config.cfg

2: Creating an init file locally using the CLI and the GPU produces the following error:

python -m spacy init config -p textcat -l en --optimize accuracy  config_trf.cfg
ℹ Generated template specific for your use case
- Language: en
- Pipeline: textcat
- Optimize for: accuracy
- Hardware: GPU
- Transformer: roberta-base
✘ Config validation error
textcat.model.tok2vec -> pooling   field required

Environment

  • spaCy version: 3.0.0rc2
  • Platform: Darwin-19.6.0-x86_64-i386-64bit
  • Python version: 3.6.11
  • Pipelines: en_core_web_sm (3.0.0a0), en_core_web_lg (3.0.0a0), en_core_web_trf (3.0.0a0)
docs

Most helpful comment

Thanks for the report, looks like we forgot to re-deploy the docs when publishing the new nightly version 🤦‍♀️ (Need to remember this in the future!) I just triggered a new build, so the quickstart widget template should be updated in a few mins. (It uses the same template as init config under the hood.)

All 3 comments

Thanks for the report, looks like we forgot to re-deploy the docs when publishing the new nightly version 🤦‍♀️ (Need to remember this in the future!) I just triggered a new build, so the quickstart widget template should be updated in a few mins. (It uses the same template as init config under the hood.)

Great, the new base-config file fixed the first issue.

There's still the second bug that results from using the local init command rather than the quickstart base-config. Should I create a separate issue for that one? If you give me a :+1: I'll do that.

Yes, thanks, that may be the most clear ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajayrfhp picture ajayrfhp  ·  3Comments

TropComplique picture TropComplique  ·  3Comments

ank-26 picture ank-26  ·  3Comments

besirkurtulmus picture besirkurtulmus  ·  3Comments

armsp picture armsp  ·  3Comments