mne-python: Segmentation fault when computing ICA

tl;dr: randomized PCA from sklearn is causing a segmentation error, switching to PCA with svd_solver='full' seems to fix this issue.

I’m trying to compute ICA on an EEG dataset with annotations created in the interactive plot window. Everything works fine, but if I append segments between specific events via raw.annotations.append I get a segmentation error:

Python(6414,0x7fffe29793c0) malloc: *** mach_vm_map(size=18446744065369096192) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Segmentation fault: 11

I’ve traced the issue as far back as line 258 in sklearn/utils/extmath:

Q, _ = linalg.lu(safe_sparse_dot(A, Q), permute_l=True)

Which is called somewhere along the line by randomized_svd, which means that the PCA object is created using svd_solver='randomized'. I strongly assume that PCA with the randomized solver doesn’t work for some reason, because using another solver fixes this problem.

All this is happening with real data during my analysis pipeline, so I don’t have a MWE at the moment (and it would probably take me quite a while to create it, so I’m hoping this won’t be necessary).

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (33 by maintainers)

Most upvoted comments

use MKL-versions of numpy and scipy should be enough