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

OSError: Unable to open file (truncated file: eof = 63504384, sblock->base_addr = 0, stored_eof = 374434776) #224

Open
gerdos opened this issue Jan 27, 2023 · 0 comments

Comments

@gerdos
Copy link

gerdos commented Jan 27, 2023

I was constantly getting the following error:

  File "parse_data.py", line 10, in <module>
    embedder = SeqVecEmbedder()
  File "/home/gerdos/.local/lib/python3.8/site-packages/bio_embeddings/embed/seqvec_embedder.py", line 66, in __init__
    self._model = ElmoEmbedder(
  File "/home/gerdos/.local/lib/python3.8/site-packages/allennlp/commands/elmo.py", line 175, in __init__
    self.elmo_bilm = _ElmoBiLm(options_file, weight_file)
  File "/home/gerdos/.local/lib/python3.8/site-packages/allennlp/modules/elmo.py", line 527, in __init__
    self._token_embedder = _ElmoCharacterEncoder(options_file, weight_file, requires_grad=requires_grad)
  File "/home/gerdos/.local/lib/python3.8/site-packages/allennlp/modules/elmo.py", line 312, in __init__
    self._load_weights()
  File "/home/gerdos/.local/lib/python3.8/site-packages/allennlp/modules/elmo.py", line 400, in _load_weights
    self._load_char_embedding()
  File "/home/gerdos/.local/lib/python3.8/site-packages/allennlp/modules/elmo.py", line 407, in _load_char_embedding
    with h5py.File(cached_path(self._weight_file), 'r') as fin:
  File "/home/gerdos/.local/lib/python3.8/site-packages/h5py/_hl/files.py", line 567, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
  File "/home/gerdos/.local/lib/python3.8/site-packages/h5py/_hl/files.py", line 231, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 106, in h5py.h5f.open
OSError: Unable to open file (truncated file: eof = 63504384, sblock->base_addr = 0, stored_eof = 374434776)

After a while I was able to solve it by removing the cached weight file from

/home/gerdos/.cache/bio_embeddings/seqvec/weights_file

This solve the error, so if you are having the same issue do:

rm $HOME/.cache/bio_embeddings/seqvec/weights_file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant