pytorch unpickling issue when using public repo code with my own files

Viewed 21

I'm trying to execute the following code to evaluate a model's performance.

split = 'CS'
pkl_path = './data.pkl'

if split == 'CS':
    gt_file = './data/smarthome_CS_51.json'
    classes = 51

pkl = open(pkl_path, 'rb')
logits = pickle.load(pkl, encoding='latin1')

This code is taken from this git page so it's a public repo : https://github.com/dairui01/TSU_evaluation/blob/main/Frame_map/Frame_based_map.py

But I get the following error:

Traceback (most recent call last):
  File "test-with-eval.py", line 484, in <module>
    logits = pickle.load(pkl, encoding='latin1')
_pickle.UnpicklingError: A load persistent id instruction was encountered,
but no persistent_load function was specified.

WHen I use the example version provided in the repo, it works fine. But not sure why this error appears, because I am generating the .pkl file the same way as the parent repo documents it.

The .pkl file I am using and the json file can be found here: https://drive.google.com/drive/folders/1Y-EOwSNUT1r5dxTi1MP0668weZlnLfJ9?usp=sharing

0 Answers
Related