# ValueError: \[E008\] Some current components would be lost when restoring previous pipeline state.

**URL:** <https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303>\
**Category:** Uncategorized\
**Tags:** training\
**Created:** [June 7, 2021, 4:05pm UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303 "2021-06-07T16:05:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikolaypavlov](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nikolaypavlov/32/443_2.png) [@nikolaypavlov](https://support.prodi.gy/u/nikolaypavlov)\
**Post date:** [June 7, 2021, 4:05pm UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/1 "2021-06-07T16:05:38Z")

</div>

Every time I train the model with the `--binary` flag I got the following error:

```python
$ prodigy train ner subjects en_core_web_sm --n-iter 1 --dropout 0.2 --binary --output models/company_mentions_sm
✔ Loaded model 'en_core_web_sm'
Using 906 train / 226 eval (split 20%)
Component: ner | Batch size: compounding | Dropout: 0.2 | Iterations: 1
ℹ Baseline accuracy: 0.039

=========================== ✨ Training the model ===========================

# Loss Skip Right Wrong Accuracy
-- -------- ----- ----- ----- --------
 1 2.33 0 89 138 0.392                                                                                                                                                                                                                                

Correct 89   
Incorrect 138  
Baseline 0.039             
Accuracy 0.392

Traceback (most recent call last):
  File "/Users/quetzal/.pyenv/versions/3.7.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    " __main__", mod_spec)
  File "/Users/quetzal/.pyenv/versions/3.7.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/quetzal/.pyenv/versions/company-mentions-dataset/lib/python3.7/site-packages/prodigy/ __main__.py", line 53, in <module>
    controller = recipe(*args, use_plac=True)
  File "cython_src/prodigy/core.pyx", line 321, in prodigy.core.recipe.recipe_decorator.recipe_proxy
  File "/Users/quetzal/.pyenv/versions/company-mentions-dataset/lib/python3.7/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/Users/quetzal/.pyenv/versions/company-mentions-dataset/lib/python3.7/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/Users/quetzal/.pyenv/versions/company-mentions-dataset/lib/python3.7/site-packages/prodigy/recipes/train.py", line 194, in train
    disabled.restore()
  File "/Users/quetzal/.pyenv/versions/company-mentions-dataset/lib/python3.7/site-packages/spacy/language.py", line 1139, in restore
    raise ValueError(Errors.E008.format(names=unexpected))
ValueError: [E008] Some current components would be lost when restoring previous pipeline state. If you added components after calling `nlp.disable_pipes()`, you should remove them explicitly with `nlp.remove_pipe()` before the pipeline is restored. Names of the new components: ['sentencizer']

```

Without the binary flag, everything works just fine. I'm using prodigy 1.10.8. Could you please help me with this issue?

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [June 11, 2021, 12:34am UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/2 "2021-06-11T00:34:35Z")

</div>

Hi and sorry about that, that's strange 🤔 Could you try something and see if reverting the following change here solves the problem for you?

> [@Help with --binary flag](https://support.prodi.gy/t/help-with-binary-flag/3980/7):
>
> @jpz129 @paulterhorst Sorry about that, this is very strange! I wonder if there's a recent update in spaCy that makes a difference here thinking Anyway, as a quick fix, try the following: Find your Prodigy installation (you can run prodigy stats to print the path) and open recipes/train.py. Find the following two lines and swap them (so that you're calling disable\_pipes before creating the annotation model): annot\_model = get\_annot\_model(component, nlp, labels) if binary else None disabled…

---

<div class="post-metadata">

**Author:** ![Abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Abhishek](https://support.prodi.gy/u/Abhishek)\
**Post date:** [June 11, 2021, 7:17am UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/3 "2021-06-11T07:17:00Z")

</div>

Hi Ines,  
I am using Prodigy version 1.10.7, but I when I start to train the model in --binary mode the error reappears for me:  
I have already tried swapping the `annot_model = ...` above the line `disabled = ...` in the `train` recipe. But even that does not solve the error.  
Any workarounds for this? I am trying to create a active learning pipeline.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/e/eb41b672e03ab83f37afe8d20d56dcc94cbaeef5.png)

---

<div class="post-metadata">

**Author:** ![Abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Abhishek](https://support.prodi.gy/u/Abhishek)\
**Post date:** [June 11, 2021, 12:41pm UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/4 "2021-06-11T12:41:19Z")

</div>

Hi @ines Ines,  
I am using Prodigy version 1.10.7, but I when I start to train the model in --binary mode the error reappears for me:  
I have already tried swapping the `annot_model = ...` above the line `disabled = ...` in the `train` recipe. But even that does not solve the error.  
Any workarounds for this? I am trying to create a active learning pipeline.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/e/eb41b672e03ab83f37afe8d20d56dcc94cbaeef5.png)

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [June 14, 2021, 1:58am UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/5 "2021-06-14T01:58:50Z")

</div>

> [@Abhishek](#):
>
> I am using Prodigy version 1.10.7, but I when I start to train the model in --binary mode the error reappears for me:

Can you try upgrading to v1.10.8? I think that version includes a change that might be relevant here.

---

<div class="post-metadata">

**Author:** ![groppcw](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/groppcw/32/2200_2.png) [@groppcw](https://support.prodi.gy/u/groppcw)\
**Post date:** [July 27, 2021, 8:03pm UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/6 "2021-07-27T20:03:45Z")

</div>

I'm using 1.10.8, but had the same issue; manually adding the sentencizer pipeline to the model before starting binary training on it worked, though.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [July 28, 2021, 6:57am UTC](https://support.prodi.gy/t/valueerror-e008-some-current-components-would-be-lost-when-restoring-previous-pipeline-state/4303/7 "2021-07-28T06:57:15Z")

</div>

> [@groppcw](#):
>
> I'm using 1.10.8, but had the same issue; manually adding the sentencizer pipeline to the model before starting binary training on it worked, though.

Thanks for the update, that's strange – but glad to hear there's a manual workaround.

The upcoming version (currently available as a [nightly pre-relase](https://support.prodi.gy/t/prodigy-nightly-spacy-v3-support-ui-for-overlapping-spans-more/3861)) will definitely resolve this problem, since it makes the binary training workflow obsolete and now uses the same process for training from binary and manual annotations (including the ability to train from a mix of binary and manual datasets).
