Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Increasing max_peels parameter causes kilosort4 to crash #863

Open
mikemanookin opened this issue Feb 4, 2025 · 0 comments
Open

BUG: Increasing max_peels parameter causes kilosort4 to crash #863

mikemanookin opened this issue Feb 4, 2025 · 0 comments

Comments

@mikemanookin
Copy link

Describe the issue:

I have been experimenting with the recently added max_peels parameter in kilosort version 4 (4.0.24) to try to reduce the number of contaminated clusters. Using the default value of 100 works fine, but increasing this value (e.g., 1000 or 10000) causes kilosort to crash. The kilosort log file is attached, but this is the most relevant part of the stack trace:

kilosort4.log

2025-02-03 17:18:26,879 kilosort.template_matching ERROR    Error in template_matching.extract on batch 274
Traceback (most recent call last):
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/template_matching.py", line 84, in extract
    stt, amps, th_amps, Xres = run_matching(ops, X, U, ctc, device=device)
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/template_matching.py", line 222, in run_matching
    st[k:k+nsp, 0] = iX[:,0]
RuntimeError: The expanded size of the tensor (69) must match the existing size (348) at non-singleton dimension 0.  Target sizes: [69].  Tensor sizes: [348]
2025-02-03 17:18:26,879 kilosort.template_matching DEBUG    X shape: torch.Size([519, 60122])
2025-02-03 17:18:26,879 kilosort.template_matching DEBUG    stt shape: torch.Size([60446, 2])
2025-02-03 17:18:26,879 kilosort.run_kilosort ERROR    Encountered error in `run_kilosort`:
Traceback (most recent call last):
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/run_kilosort.py", line 242, in run_kilosort
    st,tF, _, _ = detect_spikes(
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/run_kilosort.py", line 673, in detect_spikes
    st, tF, ops = template_matching.extract(ops, bfile, Wall3, device=device,
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/template_matching.py", line 84, in extract
    stt, amps, th_amps, Xres = run_matching(ops, X, U, ctc, device=device)
  File "/home/mike/anaconda3/envs/kilosort/lib/python3.9/site-packages/kilosort/template_matching.py", line 222, in run_matching
    st[k:k+nsp, 0] = iX[:,0]
RuntimeError: The expanded size of the tensor (69) must match the existing size (348) at non-singleton dimension 0.  Target sizes: [69].  Tensor sizes: [348]

Reproduce the bug:

Error message:

Version information:

Kilosort version 4.0.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant