Problems with decoding tutorials

Hi I am struggling to get the decoding tutorials to run, even with the code and parameters provided due to an error which I can’t quite understand.

The error is:
BaseEpochs.get_data() got an unexpected keyword argument β€˜copy’

This occurs when running the line:
X = epochs.get_data(copy=False)

Can anyone think of a reason why this is happening?

I am using the most up to date MNE and using Spyder (MNE) to run the code.

Thanks in advance!

Which tutorial produces this error?

I’ve found it with both the " Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)" and " Decoding in time-frequency space using Common Spatial Patterns (CSP)" tutorials.

Something is wrong with your Python installation then, because we continually test all tutorials and examples (which we render on our website). How did you install MNE? Can you post the output of mne.sys_info()? You might want to start in a fresh virtual environment.

I installed by downloading the installers on mne.tools. The output from sys_info is:

Platform macOS-12.4-x86_64-i386-64bit
Python 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:35:23) [Clang 15.0.7 ]
Executable /Users/u1984485/Applications/MNE-Python/1.5.1_0/.mne-python/bin/python
CPU i386 (8 cores)
Memory 16.0 GB

Core
β”œβ˜‘ mne 1.5.1
β”œβ˜‘ numpy 1.24.4 (OpenBLAS 0.3.24 with 8 threads)
β”œβ˜‘ scipy 1.11.2
β”œβ˜‘ matplotlib 3.7.2 (backend=Qt5Agg)
β”œβ˜‘ pooch 1.7.0
β””β˜‘ jinja2 3.1.2

Numerical (optional)
β”œβ˜‘ sklearn 1.3.0
β”œβ˜‘ numba 0.57.1
β”œβ˜‘ nibabel 5.1.0
β”œβ˜‘ nilearn 0.10.1
β”œβ˜‘ dipy 1.7.0
β”œβ˜‘ openmeeg 2.5.6
β”œβ˜‘ pandas 2.1.0
β””β˜ unavailable cupy

Visualization (optional)
β”œβ˜‘ pyvista 0.41.1 (OpenGL 4.1 INTEL-18.7.4 via Intel(R) Irisβ„’ Plus Graphics 645)
β”œβ˜‘ pyvistaqt 0.0.0
β”œβ˜‘ vtk 9.2.6
β”œβ˜‘ qtpy 2.4.0 (PyQt5=5.15.8)
β”œβ˜‘ ipympl 0.9.3
2024-01-10 14:22:39,181 - OpenGL.acceleratesupport - INFO - No OpenGL_accelerate module loaded: No module named β€˜OpenGL_accelerate’
β”œβ˜‘ pyqtgraph 0.13.3
β”œβ˜‘ mne-qt-browser 0.5.2
β”œβ˜‘ ipywidgets 8.1.0
β”œβ˜‘ trame_client 2.11.2
β”œβ˜‘ trame_server 2.11.7
β”œβ˜‘ trame_vtk 2.5.8
β””β˜‘ trame_vuetify 2.3.1

Ecosystem (optional)
β”œβ˜‘ mne-bids 0.13
β”œβ˜‘ mne-nirs 0.5.0
β”œβ˜‘ mne-features 0.3
β”œβ˜‘ mne-connectivity 0.5.0
β”œβ˜‘ mne-icalabel 0.4
β””β˜‘ mne-bids-pipeline 1.4.0

The latest MNE version is 1.6.1, can you upgrade and see if that solves the issue?

I think this parameter was added in 1.6

1 Like

BTW, if you want to stick with an older MNE version, you can switch the website to that version:

The tutorial/example for this version should then work for you. But I’d recommend upgrading to the latest version if you can.

2 Likes

I upgraded and the issue was solved! Thank you!