Closed vincisLab closed 2 years ago
Hi @vincisLab
A file run_ironclust.m
has been generated in your folder. Could you run it from matlab directly and check the error message ?
Hi @samuelgarcia ,
Matlab does not supply an error message. This is the result of running run_ironclust.m in MATLAB (stopped with a breakpoint right before quitting):
run_ironclust
IronClust Version: 2
Removed 0 lock(s). Running irc2.m (5.9.8) Created D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\raw_geom.prm Loaded from cache: D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\detect_ec570d7a8d8601f71c0bd4ca9167c38b\detect_irc.mat Loaded from cache: D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\detect_ec570d7a8d8601f71c0bd4ca9167c38b\sort_b5e8be3adbd834d6471ca94e5d41d629\sort_irc.mat Loaded from cache: D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\detect_ec570d7a8d8601f71c0bd4ca9167c38b\sort_b5e8be3adbd834d6471ca94e5d41d629\auto_f83832cfc7a58d1733a09ba4456e6515\auto_irc.mat
Recording format Recording file: D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\ironclust_dataset\raw.mda Probe file: D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\ironclust_dataset\geom.csv Recording Duration: 781.0s Data Type: single
#Sites: 32
#Shanks: 1
Pre-processing Filter type: bandpass Filter range (Hz): [300.0, 8000.0] Matched Filter: 0 Common ref: trimmean Whiten: 0 FFT threshold: 8 blank threshold: 0 Events
Feature extracted: gpca
#Sites/event: 12
maxDist_site_um: 50
maxDist_site_spk_um: 100
spkLim_ms: [-0.250, 0.750]
#PC/chan: 9
Cluster
#Unique events: 92789
min. spk/clu: 30
Cluster method: drift-knn
knn: 30
step_sec_drift: 20.0s
batch_sec_drift: 300.0s
Clustering result wrote to D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp/firings.mda
10 quit(0); spikeinterface gives the following output:
Error using quit
Unrecognized function or variable 'Settings'.
Error in run_ironclust (line 10)
quit(0);
We are using a Windows computer with MATLAB 2021b. Running the same code on a Mac with an older version of MATLAB worked.
@samuelgarcia Despite the error message, Ironclust seems to still work...spikeinterface says sorting returned 20 units.
@vincisLab you can load the spikesorted outout with:
import spikeinterface.sorters as ss
sorting_IC = ss.IronClustSorter.get_result_from_folder(output_folder)
Hi @alejoe91 , yes I'm able to get the results of the sorting. I suppose I can ignore the error since it doesn't appear to affect the ouput.
We're also trying to run Kilosort3 and we're getting a similar error message about 'Settings' being an unrecognized variable or function. On top of that message, we're also getting one about subscript indicies:
Error using gpuArray/subsref
Subscript indices must either be real positive integers or logicals.Error using quit
Unrecognized function or variable 'Settings'.
Error in kilosort3_master (line 43)
quit(1);
ERROR: MATLAB error Exit Status: 0x00000001
Error running kilosort3 Traceback (most recent call last): File "D:\AnacondaStuff\lib\site-packages\spikeinterface\sorters\basesorter.py", line 198, in run_from_folder SorterClass._run_from_folder(output_folder, sorter_params, verbose) File "D:\AnacondaStuff\lib\site-packages\spikeinterface\sorters\kilosortbase.py", line 42, in _run_from_folder raise Exception(f'{cls.sorter_name} returned a non-zero exit code') Exception: kilosort3 returned a non-zero exit code
Unlike with herdingspikes, sorting with kilosort fails. We saw a similar issue at https://github.com/MouseLand/Kilosort/issues/443 and they recommended changing the number of channels in the kilosort GUI. We are unsure if this is the correct fix or how we would do this with spikeinterface.
Thank you for all your help!
@vincisLab : for ironclust I don't understand what is happening. It raise an error at python level even if there is no error at matlab level ? Can you inspect the spikeinterface_log.json file to try to guess ?
For kilosort at spikeinterface level you can remove channel doing this
recording2 = recording.channel_slice(some_channel_ids)
and run the sorter on recording2
@samuelgarcia I'm having a difficult time understanding what's going on as well. I believe you are correct. My best guess is that Python is hitting an error while telling matlab to quit, and it crashes matlab (which basically accomplishes what it was trying to do anyways). Here's the output from the log file:
"Clustering result wrote to D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp/firings.mda", "#SF-SORTER-RUNTIME#58.838#", "{\bError using <a href=\"matlab:matlab.internal.language.introspective.errorDocCallback('quit')\" style=\"font-weight:bold\">quit", "Unrecognized function or variable 'Settings'.", "", "Error in <a href=\"matlab:matlab.internal.language.introspective.errorDocCallback('run_ironclust', 'D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\run_ironclust.m', 10)\" style=\"font-weight:bold\">run_ironclust (<a href=\"matlab: opentoline('D:\spikesorting\dataTest\CB250\CB250_082421_recording\results_ironclust\tmp\run_ironclust.m',10,0)\">line 10)", "quit(0);", "}\b"
Sorry for all the confusion.
The error message looks weird with this kind of <a href=
@alejoe91 : do you remeber why with have quit(0);
at th end of the generated script ?
Maybe removing it (line 208) could fix the stuff. @vincisLab : could you try this ?
Seems related to this: https://ch.mathworks.com/matlabcentral/answers/1566246-got-error-using-exit-in-nodesktop-mode
@vincisLab can you try to do the suggested action? Disable the "help imporve MATLAB" from the settings
Is the quit(0) necessary ?
yes, because that triggers an error on the SI side
the quitt(1) trigger an error but why the quit(0) ?
Hi guys, thanks for the help.
@alejoe91 removing the "help improve MATLAB" from the preferences prevent the error to appear, so all good with Ironclust.
@samuelgarcia As per Kilosort3 we still get the error even changing the number of channel with the channel_slice command .
here is the error:
Time 0s. Computing whitening matrix..
Getting channel whitening matrix...
Channel-whitening matrix computed.
Time 3s. Loading raw data and applying filters...
Time 8s. Finished preprocessing 477 batches.
----------------------------------------Error using gpuArray/subsref
Subscript indices must either be real positive integers or logicals.ERROR: MATLAB error Exit Status: 0x00000001
Error running kilosort3 Traceback (most recent call last): File "D:\AnacondaStuff\lib\site-packages\spikeinterface\sorters\basesorter.py", line 198, in run_from_folder SorterClass._run_from_folder(output_folder, sorter_params, verbose) File "D:\AnacondaStuff\lib\site-packages\spikeinterface\sorters\kilosortbase.py", line 42, in _run_from_folder raise Exception(f'{cls.sorter_name} returned a non-zero exit code') Exception: kilosort3 returned a non-zero exit code
SpikeSortingError Traceback (most recent call last)
close for lack of activity
Hi, we were able to successfully run Ironclust through the old version of spikeinterface on a Mac. However, trying to run Ironclust using the NEW spikeinterface on Windows on the same dataset as before produces this error. Interestingly, it seems like the sorting ran successfully.
Clustering result wrote to D:\ironclust_test_with_params2\tmp/firings.mda
SF-SORTER-RUNTIME#110.460
Error using quit
Unrecognized function or variable 'Settings'.
Error in run_ironclust (line 10)
quit(0);
ironclust run time 122.03s
Any information you can give on why this error appears would be greatly appreciated!