Expected dtype object, got 'numpy.dtype[float64]'

  • MNE-Python version: 0.23
  • operating system: win10
bids_path = BIDSPath(subject=subject_id, task='test',

raw = read_raw_bids(bids_path=bids_path,

I used read_raw_bids in the last few days. But it did not work today when I try to run the same code again. it rased the error"expected dtype object, got ‘numpy.dtype[float64]’". I have tried the read_raw_brainvision, it also didn’t work. anyone can help me fix this problem? or give me some suggestions? Appreciate in advance

Hey @XiaTaopsycho could you please post the full error message (the full traceback)

Hello! I’ve been encountering the same issue.
I also have the MNE 0.23 version on windows 10
Here is what I get :

mne.io.read_raw_gdf( "C:/Users/Public/Documents/imagined_S101.gdf", preload=True )
Extracting EDF parameters from C:\Users\Public\Documents\imagined_S101.gdf...
GDF file detected
Setting channel info structure...
Creating raw.info structure...
Traceback (most recent call last):

  File "<ipython-input-14-6ef4ccb4f56c>", line 1, in <module>
    mne.io.read_raw_gdf( "C:/Users/Public/Documents/imagined_S101.gdf", preload=True )

  File "C:\ProgramData\Anaconda3\lib\site-packages\mne\io\edf\edf.py", line 1366, in read_raw_gdf
    return RawGDF(input_fname=input_fname, eog=eog, misc=misc,

  File "<decorator-gen-198>", line 24, in __init__

  File "C:\ProgramData\Anaconda3\lib\site-packages\mne\io\edf\edf.py", line 197, in __init__
    super().__init__(info, preload, filenames=[input_fname],

  File "<decorator-gen-179>", line 24, in __init__

  File "C:\ProgramData\Anaconda3\lib\site-packages\mne\io\base.py", line 257, in __init__

  File "C:\ProgramData\Anaconda3\lib\site-packages\mne\io\base.py", line 536, in _preload_data
    (0, len(self.times) - 1, 0., self.times[-1]))

  File "C:\ProgramData\Anaconda3\lib\site-packages\mne\io\base.py", line 1580, in times
    out = _arange_div(self.n_times, float(self.info['sfreq']))

TypeError: expected dtype object, got 'numpy.dtype[float64]'

I am having the same issue with all my GDF files.
I also tried updating numpy to version 1.22.4 but no changes…
Any ideas what this might be due to? Thanks in advance!

can you share one file with us to see if we can replicate the problem?


Hello @icasso, I’d suggest you create a new MNE-Python environment with the latest version, following our installation instructions at:


Hello thanks for answering! you can find one here

I have no problem loading this file with the latest version of mne

In [1]: import mne
In [2]: raw = mne.io.read_raw(‘imagined_S103.gdf’)
:1: RuntimeWarning: Omitted 1 annotation(s) that were outside data range.
raw = mne.io.read_raw(‘imagined_S103.gdf’)

In [3]: raw.plot()
Out[3]: <mne_qt_browser._pg_figure.MNEQtBrowser at 0x7fe3f8ff6a60>


Hello thanks for your answers, I have tried with the new mne version in a new environment with no success. I will try re-installing anaconda

You can also use one of our installers, they contain everything you need and actually deploy an entire conda installation.

In case someone is interested and for reference, I had the same error and I solved it by updating my numba version.