Hi all,
I'm getting this exception in the "Computing features" step of a "klusta --detect-only ..." run:
AttributeError: 'NoneType' object has no attribute 'dtype'
It appears that this problem is a result of a channel group with sparse threshold-crossings.
The relevant part of the traceback is pasted at the end here, and it goes back to the last few steps in run_serial(). I poked into pdb a bit and the problem seems to lie in extracting *subsets* of channel-group spikes on which to train a PCA transform. Here, _iter_spikes() keeps only a fraction of the threshold-crossings, which has led to at least one of my channel groups being missed entirely. I.e., w_subset[channel] == None, and subsequently pcs[channel] == None.
Next, in step_extract() *all* threshold-crossings are considered and projected. However, there is no projection where pcs[channel] == None and the PCA.transform() inadvertently returns None. (The implicit return is invoked, since "if pcs is not None" evaluates False.) That brings me to the AttributeError.
It seems to me that I could either skip fewer samples before learning projections, or I could just leave out the sparsely spiking channel groups. In the latter case, can I simply skip "storing" samples from the bad group in step_extract()? BTW lower the strong threshold also avoids the exception, but that's lame.
Many thanks,
Mike
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/klusta/launch.py", line 65, in detect
out = sd.run_serial(traces, interval_samples=interval_samples)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/klusta/traces/spikedetekt.py", line 709, in run_serial
self.step_extract(n_samples=n_samples, pcs=pcs, thresholds=thresholds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/klusta/traces/spikedetekt.py", line 656, in step_extract
out['features'] = self.features(out['waveforms'], pcs[group])
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/klusta/traces/spikedetekt.py", line 451, in features
assert out.dtype == np.float32
AttributeError: 'NoneType' object has no attribute 'dtype'