Flair: UnpicklingError: pickle data was truncated

Created on 11 Jul 2019  路  3Comments  路  Source: flairNLP/flair

Describe the bug
UnpicklingError: pickle data was truncated

I got the above error while executing this:
sfd = SequenceTagger.load('frame-fast') # semantic frame detection


UnpicklingError Traceback (most recent call last)
in
----> 1 sfd = SequenceTagger.load('frame-fast') # semantic frame detection

~/anaconda3/envs/ws-1/lib/python3.7/site-packages/flair/nn.py in load(cls, model)
99 # see https://github.com/zalandoresearch/flair/issues/351
100 f = flair.file_utils.load_big_file(str(model_file))
--> 101 state = torch.load(f, map_location=flair.device)
102
103 model = cls._init_model_with_state_dict(state)

~/anaconda3/envs/ws-1/lib/python3.7/site-packages/torch/serialization.py in load(f, map_location, pickle_module, *pickle_load_args)
385 f = f.open('rb')
386 try:
--> 387 return _load(f, map_location, pickle_module, *
pickle_load_args)
388 finally:
389 if new_fd:

~/anaconda3/envs/ws-1/lib/python3.7/site-packages/torch/serialization.py in _load(f, map_location, pickle_module, *pickle_load_args)
572 unpickler = pickle_module.Unpickler(f, *
pickle_load_args)
573 unpickler.persistent_load = persistent_load
--> 574 result = unpickler.load()
575
576 deserialized_storage_keys = pickle_module.load(f, **pickle_load_args)

UnpicklingError: pickle data was truncated

Environment (please complete the following information):

  • OS [e.g. iOS, Linux]: Ubuntu 16.04
  • Version [e.g. flair-0.3.2]: flair 0.4.2

Additional context
I have 16 gb of RAM. I tried emptying the RAM and then rerunning it but no luck.

Help needed.

bug wontfix

Most helpful comment

having the same problem, when try to load en-sentiment

All 3 comments

having the same problem, when try to load en-sentiment

Could it be that you ran out of disk space when downloading the model?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings