Closed ibadr closed 9 years ago
The line that caused the crash in the comment above is exactly the same line that resulted in a crash in my first comment in https://github.com/kwikteam/phy/issues/581#issuecomment-131598343
A possibly related error occurs while re-clustering using the API with IPython
session=Session(kwik_path,channel_group=1)
session.cluster()
...
INFO klustakwik: Iteration 115F: 7 clusters, 4 changed, score=-1828819.268405 (decreased by 0.007925)
INFO klustakwik: Iteration 116F: 7 clusters, 1 changed, score=-1828819.275824 (decreased by 0.007420)
INFO klustakwik: Iteration 117F: 7 clusters, 0 changed, score=-1828819.275377 (decreased by -0.000447)
INFO klustakwik: No points changed and last step was full, so trying to split.
INFO klustakwik: Trying to split clusters
INFO klustakwik: No points changed, previous step was full and did not split, so finishing.
14:31:55 [I] The automatic clustering process has finished.
14:31:55 [I] Switched to `empty` clustering.
14:31:55 [I] Switched to `main` clustering.
Initializing features and masks: 100.0%.
Features and masks initialized.←[K
Initializing features and masks: 100.0%.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-75-b1cc71342cde> in <module>()
----> 1 session.cluster()
c:\users\islam\phy\phy\session\session.py in cluster(self, clustering, algorithm, spike_ids, channel_group, **kwargs)
434 if clustering == 'main':
435 self.model.copy_clustering('main', 'original')
--> 436 self.change_clustering(clustering)
437
438 # Set the new clustering metadata.
c:\users\islam\phy\phy\session\session.py in change_clustering(self, clustering)
214 self.model.clustering = clustering
215 info("Switched to `{}` clustering.".format(clustering))
--> 216 self.emit('open')
217
218 def on_open(self):
c:\users\islam\phy\phy\utils\event.py in emit(self, event, *args, **kwargs)
126 kwargs = {n: v for n, v in kwargs.items()
127 if n in argspec.args}
--> 128 res.append(callback(*args, **kwargs))
129 return res
130
c:\users\islam\phy\phy\session\session.py in on_open(self)
217
218 def on_open(self):
--> 219 self._create_cluster_store()
220
221 def on_close(self):
c:\users\islam\phy\phy\session\session.py in _create_cluster_store(self)
201 # If the cluster store already exists and is consistent
202 # with the data, it is not recreated.
--> 203 self.store.generate()
204
205 def change_channel_group(self, channel_group):
c:\users\islam\phy\phy\io\store.py in generate(self, mode)
661 debug("Initializing the cluster store for {0:s}.".format(name))
662 for item in self._items.values():
--> 663 item.store_all(mode)
664
665 # Load
c:\users\islam\phy\phy\io\kwik\store_items.py in store_all(self, mode)
442 if need_generate:
443 spc = {cluster: self._subset_spikes_cluster(cluster, force=True)
--> 444 for cluster in clusters_to_generate}
445
446 # All spikes to fetch and save in the store.
c:\users\islam\phy\phy\io\kwik\store_items.py in <dictcomp>(.0)
442 if need_generate:
443 spc = {cluster: self._subset_spikes_cluster(cluster, force=True)
--> 444 for cluster in clusters_to_generate}
445
446 # All spikes to fetch and save in the store.
c:\users\islam\phy\phy\io\kwik\store_items.py in _subset_spikes_cluster(self, cluster, force)
390 def _subset_spikes_cluster(self, cluster, force=False):
391 if force or cluster not in self._spikes_per_cluster:
--> 392 spikes = self._selector.subset_spikes_clusters([cluster])[cluster]
393 # Persist the new _spikes_per_cluster array on disk.
394 self._spikes_per_cluster[cluster] = spikes
KeyError: 7
Interestingly, even though KlustKwik reported 7 clusters, only 6 clusters got written to the disk:
In [76]: session.model.describe()
Kwik file C:\Users\islam\phytest\TDT\experiment_Block-2.kwik
Recordings 1
List of shanks 0, 1*, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1
6, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Clusterings main*, empty, original
Channels 1
Spikes 181276
Clusters 6
Duration 3625s
Has this issue been resolved? I just upgraded to phy 0.2.2, but I am still getting the exact same error as ibadr above (and the same as I was getting with phy 0.2.1), resulting in: IndexError: index 82496 is out of bounds for axis 0 with size 66202
I get this same error whether I do session.change_channel_group(1) from ipython, or phy phy cluster-auto --channel-group=1 kwikdata.prm
If I do $ phy cluster-manual amplifier.kwik --channel-group=1, I get:
Traceback (most recent call last):
File "\miniconda3\lib\runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "\miniconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "\miniconda3\Scripts\phy.exemain.py", line 9, in
Any updates? Thanks in advance for the help!
Same settings as in #619 .. now when trying to re-sort data on a single shank, I get this traceback
This is my parameter file