NUSTM / ACOS

The datasets and code of ACL 2021 paper "Aspect-Category-Opinion-Sentiment Quadruple Extraction with Implicit Aspects and Opinions".
193 stars 29 forks source link

pickle.UnpicklingError #7

Closed fikadata closed 2 years ago

fikadata commented 2 years ago

When I try to run project (sh run.sh) I get:

Traceback (most recent call last): File "run_step1.py", line 481, in main() File "run_step1.py", line 353, in main model = model_dict[args.model_type].from_pretrained(args.bert_model, num_labels=num_labels) File "/home/filip/ACOS/BERT/pytorch_pretrained_BERT/ACOS-main/Extract-Classify-ACOS/modeling.py", line 721, in from_pretrained state_dict = torch.load(resolved_archive_file, map_location='cpu') File "/opt/conda/lib/python3.8/site-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/opt/conda/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

Does anyone have similar issue? I modified the corresponding BERT_BASE_DIR, BASE_DIR, DATA_DIR and output_dir.

fikadata commented 2 years ago

I solved the issue, there was a problem with BERT_BASE_DIR_PATH and downloading of BERT model.