utterworks / fast-bert

Super easy library for BERT based NLP models
Apache License 2.0
1.86k stars 341 forks source link

PicklingError: Can't pickle <class 'fast_bert.data_cls.InputFeatures'>: import of module 'fast_bert.data_cls' failed #299

Open hafid34bba opened 3 years ago

hafid34bba commented 3 years ago

Hi

I am trying to use Roberta model with Fast-bert but it fail and give me the following error

PicklingError Traceback (most recent call last)

in () 12 multi_gpu=True, 13 multi_label=False, ---> 14 model_type='roberta') 3 frames /usr/local/lib/python3.7/dist-packages/torch/serialization.py in _save(obj, zip_file, pickle_module, pickle_protocol) 482 pickler = pickle_module.Pickler(data_buf, protocol=pickle_protocol) 483 pickler.persistent_id = persistent_id --> 484 pickler.dump(obj) 485 data_value = data_buf.getvalue() 486 zip_file.write_record('data.pkl', data_value, len(data_value)) PicklingError: Can't pickle : import of module 'fast_bert.data_cls' failed