ZHAOTING / dialog-processing

NLG and NLU for dialogue processing
Apache License 2.0
43 stars 10 forks source link

Unable to load pre-trained model weights in the evaluation script. #3

Closed aniket03 closed 4 years ago

aniket03 commented 4 years ago

Hi @ZHAOTING

Thank you for making the code and data for the paper Designing Precise and Robust Dialogue Response Evaluators public.

I was trying to load pre-trained model weights (made available here ) into the evaluation script (shared here), but torch.load with the model_file_path results in the error:_pickle.UnpicklingError: invalid load key, 'f', with the following trace:

Traceback (most recent call last):
  File "/Users/aniket/miniconda3/envs/roberta-eval/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/aniket/miniconda3/envs/roberta-eval/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/aniket/dialog-processing/src/tasks/response_eval/eval.py", line 139, in <module>
    model.load_model(config.model_path)
  File "/Users/aniket/dialog-processing/src/model/response_eval/roberta.py", line 160, in load_model
    map_location=lambda storage, loc: storage
  File "/Users/aniket/miniconda3/envs/roberta-eval/lib/python3.7/site-packages/torch/serialization.py", line 585, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/Users/aniket/miniconda3/envs/roberta-eval/lib/python3.7/site-packages/torch/serialization.py", line 755, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'f'.

I tried a bunch of things here:

Can you share what pre-processing needs to be done to the shared weights file so that it can be passed to the evaluation script. Would be super helpful.

ZHAOTING commented 4 years ago

Hi @aniket03, thanks for the info!

I am experiencing the same problem on my laptop. The machine where I saved the model weights file is not accessible for the moment. Please wait for some time until I can access the machine and check the problem.

ZHAOTING commented 4 years ago

Hi @aniket03, I guess Zenodo corrupted the file when I uploaded it via command line. I have uploaded to Zenodo a new uncompressed weight file (size: 1.4GB) that works on my laptop, please check it out.

If there is no further problem, please feel free to close this issue. Thanks!

aniket03 commented 4 years ago

Hi @ZHAOTING Thank you for helping with this issue. Will close this now.