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

NER training fails: Process finished with exit code -1073741819 (0xC0000005) #2662

Closed
dkarmon opened this issue Aug 13, 2018 · 10 comments
Closed
Labels
bug Bugs and behaviour differing from documentation

Comments

@dkarmon
Copy link

dkarmon commented Aug 13, 2018

I tried to train a new NER model based on the sample code in your site with my data (less than 4K records).
After only a few training iterations the training process suddenly fails with the following error message:

Process finished with exit code -1073741819 (0xC0000005)

I suspected that it had something to do with the batch, size but even if I try to train it example by example the training process fails.

I could not reproduce the error during debug - so maybe it's a memory leak issue? (allocation\releasing)
Please advise

Your Environment

  • Operating System: Win10
  • Python Version Used: 3.6.4
  • spaCy Version Used: 2.0.12
@dkarmon dkarmon changed the title NER training fails (Process finished with exit code -1073741819) NER training fails: Process finished with exit code -1073741819 (0xC0000005) Aug 13, 2018
@dkarmon
Copy link
Author

dkarmon commented Sep 5, 2018

I've managed to reproduce the error in debug mode. It seems that the batch size is indeed the root cause as if the batch contains more than 8 items the training process would eventually fail with that error code. However, if I switch to small batches, the training process would be completed.

@honnibal \ @ines please advise

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Sep 10, 2018
@ghost
Copy link

ghost commented Sep 10, 2018

I'm stuck at the exact problem for four days now. Getting that same error especially when I use training dataset of about 200 or more. I've no idea what the cause is. I'm trying to add a new entity type to a Spanish model But I'm stuck. Can someone please, please help. Thank you.

Environment:

spaCy version      2.0.12
Platform           Windows-10-10.0.17134-SP0
Python version     3.6.5
Models             en, es

@honnibal
Copy link
Member

@Nandee89 The most likely cause is a batch that has an unusually large number of total words. How many words are in each of your documents, and how big is your batch size?

@ghost
Copy link

ghost commented Sep 10, 2018

@honnibal Thank you for responding. I'm training it on a batch size of 799 examples which has a total of 26506 words. Documents/texts are of different sizes.

@ghost
Copy link

ghost commented Sep 10, 2018

I also suspected that the dataset is too big..But I thought the larger the data the better model I would get. So I train a model on a smaller data and then try to retrain that model with another 150 batch hoping that the weights get updated. That approach lowered the quality of the model.

@ghost
Copy link

ghost commented Sep 10, 2018

https:/explosion/spacy/blob/master/examples/training/train_new_entity_type.py

I'm trying to train it using the script found at the above link but with a Spanish model

@ghost
Copy link

ghost commented Sep 10, 2018

It seems that the problem is with using a pre-existing model. I trained a blank Language class with the 799 training examples and I didn't crash at all. I trained two times and worked well in both.

if model is not None:
nlp = spacy.load(model) # load existing spaCy model
print("Loaded model '%s'" % model)
else:
nlp = spacy.blank('es') # create blank Language class
print("Created blank 'es' model")

@dkarmon
Copy link
Author

dkarmon commented Sep 13, 2018

@honnibal I used a batch size of 64 where each instance consists of approximately 15 tokens.

@honnibal
Copy link
Member

honnibal commented Nov 3, 2018

This problem should now be resolved --- v2.0.17 has a fix for a memory error I think was at fault. You can already try it with pip install spacy==2.0.17.dev1 if you see this before 2.0.17 is out.

@honnibal honnibal closed this as completed Nov 3, 2018
@lock
Copy link

lock bot commented Dec 3, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants