I am trying to go through the EEG source reconstruction and stuck at the creating of a forward model. What I am trying to do: I use this tutorial to create a forward operator with fsaverage. I followed the steps of the tutorial replacing the eegbci dataset with my data and making other minor changes (fixed channel names in specific way). Script worked well right until the make_forward_solution call which stopped at “Loading the solution matrix…” and gave me a traceback ending up with “TypeError: only size-1 arrays can be converted to Python scalars”. Unfortunately, I didn’t have any other messages that’d clarify what’s going on so I decided to just download the script attached to the tutorial and run it without a change. The result was the same, and I have no idea of what happened. What am I doing wrong?
MNE version: 1.2.2
operationg system: Windows 10
Full console output from the tutorial script, including the exception traceback:
> 0 files missing from root.txt in C:\Users\Admin\mne_data\MNE-fsaverage-data
> 0 files missing from bem.txt in C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage
> Extracting EDF parameters from C:\Users\Admin\mne_data\MNE-eegbci-data\files\eegmmidb\1.0.0\S001\S001R06.edf...
> EDF file detected
> Setting channel info structure...
> Creating raw.info structure...
> Reading 0 ... 19999 = 0.000 ... 124.994 secs...
> EEG channel type selected for re-referencing
> Adding average EEG reference projection.
> 1 projection items deactivated
> Average reference projection was added, but has not been applied yet. Use the apply_proj method to apply it.
> Reading C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage\bem\fsaverage-ico-5-src.fif...
> Using outer_skin.surf for head surface.
> Channel types:: eeg: 64
> Projecting sensors to the head surface
> Source space : C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage\bem\fsaverage-ico-5-src.fif
> MRI -> head transform : E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\data\fsaverage\fsaverage-trans.fif
> Measurement data : instance of Info
> Conductor model : C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage\bem\fsaverage-5120-5120-5120-bem-sol.fif
> Accurate field computations
> Do computations in head coordinates
> Free source orientations
>
> Reading C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage\bem\fsaverage-ico-5-src.fif...
> Read 2 source spaces a total of 20484 active source locations
>
> Coordinate transformation: MRI (surface RAS) -> head
> 0.999994 0.003552 0.000202 -1.76 mm
> -0.003558 0.998389 0.056626 31.09 mm
> -0.000001 -0.056626 0.998395 39.60 mm
> 0.000000 0.000000 0.000000 1.00
>
> Read 64 EEG channels from info
> Head coordinate coil definitions created.
> Source spaces are now in head coordinates.
>
> Setting up the BEM model using C:\Users\Admin\mne_data\MNE-fsaverage-data\fsaverage\bem\fsaverage-5120-5120-5120-bem-sol.fif...
>
> Loading surfaces...
>
> Loading the solution matrix...
>
> Traceback (most recent call last):
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec
> exec(code, globals, locals)
>
> File "e:\work\mbs\eeg\modelling\sources\smth\35_eeg_no_mri.py", line 78, in <module>
> fwd = mne.make_forward_solution(raw.info, trans=trans, src=src,
>
> File "<decorator-gen-394>", line 12, in make_forward_solution
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\forward\_make_forward.py", line 591, in make_forward_solution
> sensors, rr, info, update_kwargs, bem = _prepare_for_forward(
>
> File "<decorator-gen-393>", line 12, in _prepare_for_forward
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\forward\_make_forward.py", line 448, in _prepare_for_forward
> bem = _setup_bem(bem, bem_extra, len(eegnames), mri_head_t,
>
> File "<decorator-gen-390>", line 12, in _setup_bem
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\forward\_make_forward.py", line 241, in _setup_bem
> bem = read_bem_solution(bem)
>
> File "<decorator-gen-74>", line 12, in read_bem_solution
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\bem.py", line 1560, in read_bem_solution
> bem = _read_bem_solution_fif(fname)
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\bem.py", line 1643, in _read_bem_solution_fif
> tag = find_tag(fid, bem_node, FIFF.FIFF_BEM_POT_SOLUTION)
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\io\tag.py", line 504, in find_tag
> return read_tag(fid, subnode.pos)
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\io\tag.py", line 469, in read_tag
> tag.data = _read_matrix(fid, tag, shape, rlims, matrix_coding)
>
> File "E:\Program Files\Anaconda\envs\mne\lib\site-packages\mne\io\tag.py", line 184, in _read_matrix
> ndim = int(np.frombuffer(fid.read(4), dtype='>i4'))
>
> TypeError: only size-1 arrays can be converted to Python scalars