cortex-lab / KiloSort

GPU code for spike sorting
GNU General Public License v2.0
175 stars 100 forks source link

Warning: Error making figure was: Argument must be a Figure object or a positive integer. #263

Closed lrfreeman closed 1 year ago

lrfreeman commented 1 year ago

Hi there,

I have run into this error when using either KS3 or KS2.5. The only difference is that with 2.5 the programme continues whereas KS3 stops. Given than KS2.5 continues until end, and produces all results as expected such as spike times, cluster ids, etc and I can use Phy. The questions I have are this:

  1. Is this error effecting the results in anyway?
  2. Do you have any solutions to try to fix it so I can use KS3 assuming the error is a debug figure and not effecting results

I'm running:

image


Time   0s. Computing whitening matrix.. 
Getting channel whitening matrix... 
Channel-whitening matrix computed. 
Time   3s. Loading raw data and applying filters... 
Time  85s. Finished preprocessing 470 batches. 
pitch is 15 um
0.20 sec, 1 batches, 2199 spikes 
15.38 sec, 101 batches, 226296 spikes 
30.50 sec, 201 batches, 434168 spikes 
45.49 sec, 301 batches, 671250 spikes 
60.40 sec, 401 batches, 905111 spikes 
70.72 sec, 470 batches, 1057989 spikes 
time 122.08, Shifted up/down 470 batches. 
Time 125s. Optimizing templates ...
125.09 sec, 1 / 470 batches, 46 units, nspks: 5.2593, mu: 17.3838, nst0: 66, merges: 0.0000, 0.0000, 2.2000 
138.96 sec, 101 / 470 batches, 135 units, nspks: 1427.4727, mu: 14.0652, nst0: 1703, merges: 122.8181, 0.1498, 27.3448 
152.72 sec, 201 / 470 batches, 137 units, nspks: 1529.9989, mu: 13.9270, nst0: 1336, merges: 138.0582, 0.0182, 27.5406 
166.33 sec, 301 / 470 batches, 131 units, nspks: 1580.7575, mu: 13.9144, nst0: 1381, merges: 135.0577, 0.0172, 26.9420 
Warning: Error making figure was: Argument must be a Figure object or a positive integer. 
> In learnTemplates (line 260)
In learnAndSolve8b (line 35)
In ksGUI/runSpikesort (line 786)
In ksGUI/runAll (line 628)
In ksGUI>@(~,~)obj.runAll() (line 319) 
179.67 sec, 401 / 470 batches, 131 units, nspks: 1498.6388, mu: 13.2335, nst0: 1398, merges: 125.4773, 0.0021, 24.8996 
Warning: Error making figure was: Argument must be a Figure object or a positive integer. 
> In learnTemplates (line 260)
In learnAndSolve8b (line 35)
In ksGUI/runSpikesort (line 786)
In ksGUI/runAll (line 628)
In ksGUI>@(~,~)obj.runAll() (line 319) 
Elapsed time is 188.776199 seconds.
Finished learning templates 
Time 189s. Optimizing templates ...
189.04 sec, 1 / 470 batches, 112 units, nspks: 1581.0000, mu: 14.5205, nst0: 3722 
198.33 sec, 101 / 470 batches, 112 units, nspks: 156089.0000, mu: 14.5205, nst0: 3211 
207.41 sec, 201 / 470 batches, 112 units, nspks: 304853.0000, mu: 14.5205, nst0: 2983 
217.02 sec, 301 / 470 batches, 112 units, nspks: 474782.0000, mu: 14.5205, nst0: 4638 
226.53 sec, 401 / 470 batches, 112 units, nspks: 639775.0000, mu: 14.5205, nst0: 3036 
Elapsed time is 232.992521 seconds.
Number of spikes before applying cutoff: 1657763
initialized spike counts
Found 0 splits, checked 1/112 clusters, nccg 0 
Found 31 splits, checked 101/143 clusters, nccg 9 
Finished splitting. Found 33 splits, checked 145/145 clusters, nccg 16 
Removing 820228 spikes below cutoff from rez.
lrfreeman commented 1 year ago

Solved - I was closing the figures which prevented subsequent batches calling that figure handle and thus would crash. Tested on both KS2.5 and KS3.