Skip to content

Kernel appears to have crashed with mne.viz #9333

@ilonadem

Description

@ilonadem

MNE version 0.22.1
Python version 3.8.5
Remote jupyter notebook/google colab

Describe the bug

I have been trying to run several of the jupyter tutorials from the mne website in a remote jupyter notebook. Each time I try to run any command that uses mne.viz(), or any other interactive visualization, the kernel restarts and I get the message "the kernel appears to have died"

Steps to Reproduce

For example, I get the "kernel appears to have died" message when I run the following code:

%matplotlib inline

import mne
Brain = mne.viz.get_brain_class()

subjects_dir = mne.datasets.sample.data_path() + '/subjects'
mne.datasets.fetch_hcp_mmp_parcellation(subjects_dir=subjects_dir,
                                        verbose=True)

mne.datasets.fetch_aparc_sub_parcellation(subjects_dir=subjects_dir,
                                          verbose=True)

labels = mne.read_labels_from_annot(
    'fsaverage', 'HCPMMP1', 'lh', subjects_dir=subjects_dir)

brain = Brain('fsaverage', 'lh', 'inflated', subjects_dir=subjects_dir,
              cortex='low_contrast', background='white', size=(800, 600))

In particular, the kernel crashes on the last line, when there is a call to mne.viz.get_brain_class()

Is there a workaround (maybe specific to remote jupyter notebooks) to stop this crash from happening?

Additional information
I have tried running the same code in Google colab as well, which also results in the same problem.
I have also tried running other tutorials, which similarly crash whenever I try to run any of the mne.viz() functions

Platform: Remote jupyter notebook (in CoCalc), have also tried in Google Colab
Python: 3.8.5
Executable: C:\Users\yxie\Anaconda3\python.exe
CPU: Intel(R) Xeon(R) CPU Model 85 Stepping 7
Memory: 32887760 kB

mne: 0.22.1
numpy: 1.19.5 {blas=D:\a\1\s\numpy\build\openblas_info, lapack=D:\a\1\s\numpy\build\openblas_lapack_info}
scipy: 1.5.0
matplotlib: 3.2.2 {backend=module://ipykernel.pylab.backend_inline}

sklearn: 0.0
numba: 0.51.2
nibabel: 3.1.0
nilearn: 0.6.2
dipy: Not found
cupy: Not found
pandas: 1.2.3
mayavi: Not found
pyvista: 0.29.1
vtk: 9.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions