kwikteam / klustakwik2

Fast software for high-dimensional cluster analysis using the masked EM algorithm for Gaussians mixtures
BSD 3-Clause "New" or "Revised" License
27 stars 13 forks source link

ValueError: There is no parameter num_starting_clusters #80

Open L0tusHead opened 2 years ago

L0tusHead commented 2 years ago

Hello Klustakwik2 contributors, I am currently using spike interface and I am stuck in the section that involves using Klusta. I am running these lines

sorting_KL_all = ss.run_klusta(recording_cache, output_folder='results_all_klusta', adjacency_radius=50, verbose=True)
print('Found', len(sorting_KL_all.get_unit_ids()), 'units')

The code runs but halfway through I then encounter the following errors

14:52:29 [I] launch:218           Spike detection done! 53594 spikes found in shank 0

C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\klusta\kwik\h5.py:55: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details.

  with h5py.File(path, driver='sec2') as f:

14:52:29 [I] launch:249           Starting clustering on shank 0/1.

14:52:29 [I] launch:252           Clustering group 0 (53594 spikes).

14:52:29 [I] launch:123           Starting KK...

INFO     klustakwik: KlustaKwik2 version 0.2.0

ValueError: There is no parameter num_starting_clusters

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\spikesorters\basesorter.py in run(self, raise_error, parallel, n_jobs, joblib_backend)
    157                 for i, recording in enumerate(self.recording_list):
--> 158                     self._run(recording, self.output_folders[i])
    159             else:

C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\spikesorters\klusta\klusta.py in _run(self, recording, output_folder)
    151         if retcode != 0:
--> 152             raise Exception('klusta returned a non-zero exit code')
    153 

Exception: klusta returned a non-zero exit code

During handling of the above exception, another exception occurred:

SpikeSortingError                         Traceback (most recent call last)
<ipython-input-43-bb497d375e72> in <module>
      1 # run spike sorting on entire recording
----> 2 sorting_KL_all = ss.run_klusta(recording_cache, output_folder='results_all_klusta', adjacency_radius=50, verbose=True)
      3 print('Found', len(sorting_KL_all.get_unit_ids()), 'units')

C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\spikesorters\sorterlist.py in run_klusta(*args, **kwargs)
    267         The spike sorted data
    268     """
--> 269     return run_sorter('klusta', *args, **kwargs)
    270 
    271 

C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\spikesorters\sorterlist.py in run_sorter(sorter_name_or_class, recording, output_folder, delete_output_folder, grouping_property, parallel, verbose, raise_error, n_jobs, joblib_backend, **params)
     91                          verbose=verbose, delete_output_folder=delete_output_folder)
     92     sorter.set_params(**params)
---> 93     sorter.run(raise_error=raise_error, parallel=parallel, n_jobs=n_jobs, joblib_backend=joblib_backend)
     94     sortingextractor = sorter.get_result(raise_error=raise_error)
     95 

C:\Users\HiveTeam6\Anaconda\envs\spiketutorial\lib\site-packages\spikesorters\basesorter.py in run(self, raise_error, parallel, n_jobs, joblib_backend)
    167         except Exception as err:
    168             if raise_error:
--> 169                 raise SpikeSortingError(f"Spike sorting failed: {err}. You can inspect the runtime trace in "
    170                                         f"the {self.sorter_name}.log of the output folder.'")
    171             else:

SpikeSortingError: Spike sorting failed: klusta returned a non-zero exit code. You can inspect the runtime trace in the klusta.log of the output folder.'

I am working on window 10 pro. Anything helps, thank you.

alejoe91 commented 2 years ago

can you share the log file?