# running ICA on eeg data - kernel failing

**URL:** <https://mne.discourse.group/t/running-ica-on-eeg-data-kernel-failing/1204>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 11, 2017, 7:54am UTC](https://mne.discourse.group/t/running-ica-on-eeg-data-kernel-failing/1204 "2017-04-11T07:54:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 11, 2017, 7:54am UTC](https://mne.discourse.group/t/running-ica-on-eeg-data-kernel-failing/1204/1 "2017-04-11T07:54:38Z")

</div>

Hi all,

I'm new to mne so sorry if this is a noob question, but for some reason  
both ICA and interpolate\_bads seem to keep breaking down my python kernel  
when i try to run them. Any suggestions? more details below (including code  
used)

- running version 0.14dev0 to read the cnt format as that didn't work on  
the stable version initially  
- reading EEG data from the CNT format:

\*data = mne.io.read\_raw\_cnt(fname, montage = 'standard\_1005', date\_format =  
'dd/mm/yy', eog = ['VEOG', 'HEOG'], misc = ['RM'], preload = True)\*

- rereferencing (to 'RM' channel) and resampling to 250hz, then filtering  
between 0.1 and 40Hz

\*# I know this is creating new vars, but this is deliberate\*

\*reref = data.set\_eeg\_reference(ref\_channels = ['RM'])\*

\*resamp = reref.resample(250)\*  
\*filtered = resamp.filter(0.1,40)\*

it will extract events and epoch data properly, e.g.

\*encodingEpochs = mne.Epochs(filtered, events, events\_encode, tmin, tmax,  
baseline = baseline, preload = True)\*

if I try to ICA on either the filtered data:

\*ica = mne.preprocessing.ICA(n\_components=0.95).fit(filtered)\*

or on the epoched data:

\*ica = mne.preprocessing.ICA(n\_components=0.95).fit(encodingEpochs)\*

then I get the following:

Fitting ICA to data using 61 channels  
Please be patient, this may take some time  
Inferring max\_pca\_components from picks

\*It seems the kernel died unexpectedly. Use 'Restart Kernel' to continue  
using this console\*  
this also happens if I try to interpolate bad channels, e.g.:

\*filtered.interpolate\_bads(reset\_bads=False)\*  
Sorry for the potentially excessive info, but hope it clarifies the problem  
that I'm having! Any help would be greatly appreciated.

Thanks!  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170411/f0108548/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170411/f0108548/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 11, 2017, 3:57pm UTC](https://mne.discourse.group/t/running-ica-on-eeg-data-kernel-failing/1204/2 "2017-04-11T15:57:00Z")

</div>

This is fixed: seemed to be a problem with numpy/scipy. Updating them to  
newer versions solved this problem!  
?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 11, 2017, 4:25pm UTC](https://mne.discourse.group/t/running-ica-on-eeg-data-kernel-failing/1204/3 "2017-04-11T16:25:46Z")

</div>

Great! As a tip, when you get these kind of low level messages updates  
often help. We're doing some testing for older versions but this is limited  
and quite often development takes place on quite recent versions of the  
scientific python stack. Out of curiosity can you figure out which versions  
you had before? Maybe we need to update our checks and recommendations.

Denis
