Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatched IDs error when using nlp.rehearse with listeners #12044

Open
thomashacker opened this issue Jan 2, 2023 Discussed in #10861 · 0 comments
Open

Mismatched IDs error when using nlp.rehearse with listeners #12044

thomashacker opened this issue Jan 2, 2023 Discussed in #10861 · 0 comments
Labels
bug Bugs and behaviour differing from documentation feat / textcat Feature: Text Classifier training Training and updating models

Comments

@thomashacker
Copy link
Contributor

thomashacker commented Jan 2, 2023

Discussed in #10861

Using nlp.rehearse on a pipelines with a tok2vec listener results in ValueError: [E953] Mismatched IDs.

Originally posted by nashcaps2255 May 27, 2022
Have a textcat multilabel model which I am trying to update with nlp.rehearse to alleviate the catastrophic forgetting problem.

nlp = spacy.load('my_model')

examples = []
for line in file_:
   text, label = line.split("|")
   doc = nlp(text)
   gold_dict = {"cats": {label: float(1)}}
   gold_dict = Example.from_dict(doc, gold_dict)
   examples.append(example)


optimizer = nlp.resume_training()
nlp.rehearse(examples, sgd = optimizer) 

Results in......

ValueError: [E953] Mismatched IDs received by the Tok2Vec listener: 179568814531392983158587824 vs. 2172509679243279887229
@thomashacker thomashacker added bug Bugs and behaviour differing from documentation training Training and updating models feat / textcat Feature: Text Classifier labels Jan 2, 2023
@svlandeg svlandeg linked a pull request Jan 3, 2023 that will close this issue
3 tasks
@thomashacker thomashacker changed the title Mismatched IDs error when using nlp.rehearse on textcat Mismatched IDs error when using nlp.rehearse with listeners Jan 8, 2023
@thomashacker thomashacker removed a link to a pull request Jan 23, 2023
3 tasks
@thomashacker thomashacker linked a pull request Jan 23, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation feat / textcat Feature: Text Classifier training Training and updating models
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant