klustakwik2: Buffer has wrong number of dimensions

428 views
Skip to first unread message

John Huxter

unread,
Jun 6, 2016, 12:38:09 PM6/6/16
to KlustaViewas
Has anybody seen this error running klusta? It is generated by KlustaKwik2, even though I am using all of the defaults. 
A truncated version of the screen output is below. Any wisdom appreciated!

John 

Running klusta: klusta temp_xs-ldas5-klusta2.kkparams --overwrite --cluster-only
17:31:07 [I] launch:188           Deleting `.klustakwik2`.
17:31:07 [I] launch:239           Starting clustering on shank 0/1.
17:31:07 [I] launch:242           Clustering group 0 (41900 spikes).
17:31:07 [I] launch:122           Starting KK...
INFO     klustakwik: KlustaKwik2 version 0.2.4
INFO     klustakwik.initial_parameters: use_noise_cluster = 1
INFO     klustakwik.initial_parameters: subset_break_fraction = 0.01
INFO     klustakwik.initial_parameters: full_step_every = 1
...
INFO     klustakwik.initial_parameters: num_starting_clusters = 25
INFO     klustakwik.initial_parameters: prior_point = 1
INFO     klustakwik.initial_parameters: noise_point = 1
INFO     klustakwik: Using mask starts with 25 clusters, data has 2805 unique masks
INFO     klustakwik: Clustering data set of 41900 points, 48 features
INFO     klustakwik: Starting iteration 0 with 25 clusters
ValueError: Buffer has wrong number of dimensions (expected 1, got 0)

Marton Csernai

unread,
Jun 6, 2016, 1:19:23 PM6/6/16
to John Huxter, KlustaViewas
Hi John,

I have just bumped into the same error message. I managed to get rid of it by playing around in the .prm file.

These parameters worked for me:

"# Parameters for the automatic clustering process.
klustakwik2 = dict(
     num_starting_clusters=60,
     # prior_point=1,
     # mua_point=2,
     # noise_point=1,
     # points_for_cluster_mask=100,
     # penalty_k=0.0,
     penalty_k_log_n=2.0,
     max_iterations=100,
     use_noise_cluster=False,
     # use_mua_cluster=True,
     # num_changed_threshold=0.05,
     # full_step_every=1,
     split_first=5,
     split_every=10,
     # max_possible_clusters=200,
     # dist_thresh=log(10000.0),
     # max_quick_step_candidates=100000000, # this uses around 760 MB RAM
     # max_quick_step_candidates_fraction=0.4,
     # always_split_bimodal=False,
     # subset_break_fraction=0.01,
     # break_fraction=0.0,
     # fast_split=False,
     # max_split_iterations=None,
     # consider_cluster_deletion=True,
     # num_cpus=None
)"

If I uncomment the num_cpus=None, then the this is shown when klustakwik2 starts:
"...
INFO     klustakwik.initial_parameters: max_possible_clusters = 1000
INFO     klustakwik.initial_parameters: num_cpus =
INFO     klustakwik.initial_parameters: penalty_k_log_n = 2.0
...
ValueError: Buffer has wrong number of dimensions (expected 1, got 0)"

Notice the missing value for the num_cpus parameter, and that I get the same error message.
However, I'm not sure if this is indeed what breaks or fixes the issue.

Also, as far as I can see, if you use the --cluster-only switch, then kk2 does not read the .prm file again, but it uses the parameter values which are already stored in the kwik file (I guess spikedetect or the klusta wrapper fills these into the kwik file automatically). So if you want to cluster your data with new kk2 parameters, you can try editing the kwik file and changing these parameters manually, or you have to start the klusta process from the start (with spikedetect or doing both spikedetect ang kk2 at the same time).

Hope this helps!

Best,
Marton Csernai

Bartho lab





--
To subscribe, send email to klustaviewa...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "KlustaViewas" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klustaviewas...@googlegroups.com.
To post to this group, send email to klusta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Huxter

unread,
Jun 6, 2016, 2:27:54 PM6/6/16
to KlustaViewas, j.r.h...@gmail.com
1. I can confirm that using the --cluster-only flag results in re-use of the previous clustering parameters - which seems to me unnecessary, and I'm inclined to treat it as a bug. Thanks, I hadn't spotted that. 

2. num_cpus=None does indeed seem to be a value the program is unhappy with. However, rather than comment-out that line, you can also give it a valid value (I tried "2" and it worked ok). Again, this is really a bug, because num_cpus=None is rpresumably meant to have a specified behaviour (use all CPUs?) but it does not. Unless it's a typo in the sample .PRM file.

Cheers!
John
Reply all
Reply to author
Forward
0 new messages