Reshape error while loading waveforms for passive IBL dataset

Hi I am trying to load the waveforms (together with trial and spike data) for the 373 passive sessions. For a some pids, when I run the follwing code:

#example non working pid
pid = 'bf746764-78e0-4b9c-bdf6-65b6ff45745d'
# load spikes
sl = SpikeSortingLoader(pid=pid, one=one, atlas=ba)
spikes, clusters, channels = sl.load_spike_sorting()
clusters = sl.merge_clusters(spikes, clusters, channels)
# Load the spike waveforms
spike_wfs = one.load_object(sl.eid, '_phy_spikes_subset', collection=sl.collection)

I am getting the following reshape error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/OneDrive - Karolinska Institutet/Mac/Documents/Python/IBLimport/load_all_passive_sessions_IBL.py in <module>
      5 clusters = sl.merge_clusters(spikes, clusters, channels)
      6 # Load the spike waveforms
----> 7 spike_wfs = one.load_object(sl.eid, '_phy_spikes_subset', collection=sl.collection)

/opt/anaconda3/envs/ibl/lib/python3.9/site-packages/one/util.py in wrapper(self, *args, **kwargs)
    159             mode = self.mode
    160         self.refresh_cache(mode=mode)
--> 161         return method(self, *args, **kwargs)
    162 
    163     return wrapper

/opt/anaconda3/envs/ibl/lib/python3.9/site-packages/one/util.py in wrapper(self, id, *args, **kwargs)
    143         if eid is None:
    144             raise ValueError(f'Cannot parse session ID "{id}" (session may not exist)')
--> 145         return method(self, eid, *args, **kwargs)
    146 
    147     return wrapper

/opt/anaconda3/envs/ibl/lib/python3.9/site-packages/one/api.py in load_object(self, eid, obj, collection, revision, query_type, download_only, **kwargs)
    970             return files
    971 
--> 972         return alfio.load_object(files, wildcards=self.wildcards, **kwargs)
...
--> 820             array.shape = shape
    821 
    822     return array

ValueError: cannot reshape array of size 2436384 into shape (1857,82,32)

This happens with many files. Any clue what is the problem?

Hello Pierre,

Thanks for letting us know! We’re currently looking into it but it appears some data are corrupt. We’ll document our progress here: [Bug report] - Reshape error on ephys data load · Issue #357 · int-brain-lab/iblenv · GitHub

Thanks,
Miles

Hi Pierre,

Those datasets are now fixed and you should be able to load them in without errors. Sorry for the delay and let us know if you run into any other problems.

Thanks,

Mayo

Hi Mayo,

Thanks for the help. I’ll try them now.

Best,

Pierre