mne.io.read_raw_gdf() error

Hello everyone,

I plan to import the BCI competion 4 2a dataset, and I use:

mne.io.read_raw_gdf('A01T.gdf')

I got the error massage:

UFuncTypeError: Cannot cast ufunc 'clip' output from dtype('float64') to dtype('uint32') with casting rule 'same_kind'

How can I solve this problem?

Platform Windows-10-10.0.19045-SP0
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
Executable D:\OneDrive\Study record in CQUPT\Paper_CQUPT\pythonProject\mne_local\venv\Scripts\python.exe
CPU Intel64 Family 6 Model 158 Stepping 10, GenuineIntel (6 cores)
Memory 7.8 GB

Core
β”œβ˜‘ mne 1.5.1
β”œβ˜‘ numpy 1.26.0 (unknown linalg bindings (threadpoolctl module not found: No module named β€˜threadpoolctl’))
β”œβ˜‘ scipy 1.11.3
β”œβ˜‘ matplotlib 3.8.0 (backend=QtAgg)
β”œβ˜‘ pooch 1.7.0
β””β˜‘ jinja2 3.1.2

Numerical (optional)
β”œβ˜‘ nibabel 5.1.0
β”œβ˜‘ pandas 2.1.1
β””β˜ unavailable sklearn, numba, nilearn, dipy, openmeeg, cupy

Visualization (optional)
β”œβ˜‘ qtpy 2.4.0 (PyQt5=5.15.2)
β”œβ˜‘ pyqtgraph 0.13.3
β”œβ˜‘ mne-qt-browser 0.5.2
β”œβ˜‘ ipywidgets 8.1.1
β””β˜ unavailable pyvista, pyvistaqt, vtk, ipympl, trame_client, trame_server, trame_vtk, trame_vuetify

Ecosystem (optional)
β”œβ˜‘ mne-bids 0.13
β””β˜ unavailable mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline

Hey there! I faced a similar issue with the dataset. After some troubleshooting, I discovered that there was a compatibility problem between the version of NumPy I was using and the mne processing in io.read_… function. To resolve this, I changed my NumPy version to 1.23.5, and that did the trick! To make the change, you can simply run β€œpip install numpy==1.23.5” on your terminal. Hope this helps!

2 Likes