spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

OSError on load_vectors_from_bin_loc()

Open petterhh opened this issue 9 years ago • 4 comments

I have a word2vec model (binary) that I want to load into the vocab before training with train_ud.py. Unfortunately, I'm met by an OSError when running load_vectors_from_bin_loc().

Traceback (most recent call last):
  File "spacy/bin/parser/train_ud.py", line 112, in <module>
    plac.call(main)
  File "/Users/petterhohle/.pyenv/versions/spacy/lib/python3.5/site-packages/plac_core.py", line 326, in call
    cmd, result = parser_from(obj).consume(arglist)
  File "/Users/petterhohle/.pyenv/versions/spacy/lib/python3.5/site-packages/plac_core.py", line 209, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "spacy/bin/parser/train_ud.py", line 78, in main
    vocab.load_vectors_from_bin_loc('/Users/petterhohle/coding/spacy-nor/nak_nowac.bin')
  File "spacy/vocab.pyx", line 528, in spacy.vocab.Vocab.load_vectors_from_bin_loc (spacy/vocab.cpp:10682)
  File "spacy/cfile.pyx", line 41, in spacy.cfile.CFile.alloc_read (spacy/cfile.cpp:1420)
  File "spacy/cfile.pyx", line 32, in spacy.cfile.CFile.read_into (spacy/cfile.cpp:1279)
OSError

The error message is not exactly descriptive, so I'm wondering what might be the issue here?

petterhh avatar Dec 07 '16 13:12 petterhh

Agree that the error messaging could be improved. It's difficult because we're reporting from a C error. I need to look into checking the error message properly.

Have you checked the obvious, like whether the file exists, whether you have enough memory...?

honnibal avatar Dec 10 '16 01:12 honnibal

Yeah, the file exists - for non-existing files the error is more precise; OSError: Could not open binary file b'<filename>'.

I have 8 GB memory and more than 2 GB available, which should suffice?

petterhh avatar Dec 12 '16 07:12 petterhh

Closing this and making #1046 the master issue. Work in progress for spaCy v2.0!

ines avatar May 07 '17 22:05 ines

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[bot] avatar May 08 '18 21:05 lock[bot]