Skip to content

MemoryError: Error allocating memory for feature #786

Closed

Description

@schlichtanders

Dear spaCy Team,

I tried to further train the default spacy entity recognizer, however I immediately run into a Memory Error.

import spacy
nlp = spacy.load("de")
nlp.entity.model.resume_training()

throws

MemoryError                               Traceback (most recent call last)
<ipython-input-29-6298edf1c0b7> in <module>()
----> 1 nlp.entity.model.resume_training()

C:\tools\Anaconda3\lib\site-packages\thinc\linear\avgtron.pyx in thinc.linear.avgtron.AveragedPerceptron.resume_training (thinc/linear/avgtron.cpp:4177)()

MemoryError: Error allocating memory for feature: 13665621275175813120

Have you ever encountered such things? Any suggestions how to proceed?

My Environment

  • Operating System: Windows 10
  • Python Version Used: 3.5
  • spaCy Version Used: 1.6.0
  • Environment Information: 32GB RAM

Activity

  1. added
    bug
    on Jan 29, 2017
  2. honnibal commented on Jan 29, 2017

    @honnibal
    Member

    Hi,

    Labelling this bug, because no matter the root cause that shouldn't be the expected behaviour.

    Do you have the data installed?

    Matt

  3. schlichtanders commented on Jan 30, 2017

    @schlichtanders
    Author

    thank you very much for your fast response

    I already had run long ago python -m spacy.de.download all and tried to redownload it using --force, however this behaviour is currently broken in spacy 1.6 (on master it is already fixed), hence I might have an older download from spacy 1.2

    I executed python -m spacy.en.download all and downloaded all english data.

    Still the same error. (also with the english equivalent code)

  4. schlichtanders commented on Feb 13, 2017

    @schlichtanders
    Author

    I tried it again with the new thinc master adapted for #799 however this memory allocation error is unfortunately still there.

  5. akalino commented on Mar 6, 2017

    @akalino

    I am encountering similar issues now - upgrading to thinc-6.4.0 solved my memory issues, however now I am unable to save the models I update. Traceback below:

    
      File "/mnt/alex/NER/train_general_model.py", line 277, in <module>
    
        train_client_brand_model(output_path, td)
    
      File "/mnt/alex/NER/train_general_model.py", line 211, in train_client_brand_model
    
        ner.model.dump(str(model_dir / 'model'))
    
      File "thinc/linear/avgtron.pyx", line 81, in thinc.linear.avgtron.AveragedPerceptron.dump 
    (thinc/linear/avgtron.cpp:2852)
    
    AttributeError: 'preshed.maps.PreshMap' object has no attribute 'capacity' ```
    
  6. akalino commented on Mar 6, 2017

    @akalino

    Actually, looks like an upgrade of preshed to 1.0.0 solves the issue I was seeing.

  7. honnibal commented on Mar 31, 2017

    @honnibal
    Member

    This should be fixed now -- see #910

  8. lock commented on May 9, 2018

    @lock

    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.

  9. locked as resolved and limited conversation to collaborators on May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions