Skip to content

Bug: Multisorting - Extraction from pickle #210

@marcbue

Description

@marcbue

After dumping a multisorting using (multisorting.dump_to_pickle(output_folder / 'sorting.pkl')). It can't be revovered using se.load_extractor_from_pickle(output_folder / 'sorting.pkl'). The following error occurs:


KeyError Traceback (most recent call last)
in
----> 1 multisorting = se.load_extractor_from_pickle('/data/sarah/MEA/20210504/C25/829/low/1/merged/sorting.pkl')

~/miniconda3/envs/spikesorting/lib/python3.8/site-packages/spikeextractors-0.9.6-py3.8.egg/spikeextractors/extraction_tools.py in load_extractor_from_pickle(pkl_file)
747 The loaded extractor object
748 """
--> 749 return BaseExtractor.load_extractor_from_pickle(pkl_file)
750
751

~/miniconda3/envs/spikesorting/lib/python3.8/site-packages/spikeextractors-0.9.6-py3.8.egg/spikeextractors/baseextractor.py in load_extractor_from_pickle(pkl_file)
497 with open(str(pkl_file), 'rb') as f:
498 d = pickle.load(f)
--> 499 extractor = _load_extractor_from_dict(d['serialized_dict'])
500 if 'properties' in d.keys():
501 extractor._properties = d['properties']

KeyError: 'serialized_dict'

Looking at the keys of the pickled file it didn't create the 'serialized_dict' necessary for instantiating the extractor:


import pickle
with open(output_folder / 'sorting.pkl', 'rb') as f:
        d=pickle.load(f)
        print(d.keys())

gives:

dict_keys(['class', 'module', 'kwargs', 'dumpable', 'version', 'relative_paths', 'annotations', 'properties'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    old APIIssues related to old API (<0.90)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions