question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Could not find EEG array in the .set file.

See original GitHub issue

Describe the bug

Dear MNE developers Thank you for developing this wonderful tool.

I am faced with the error when I tried to use read_raw_eeglab() to load the .set file made by EEGLAB What I did in EEGLAB is just loading the data by Quick 30 and save it in ‘.set(with ‘.fdt’)’ format only. I think this is very weird, so I guess this is bug.

The script I made is below.

subject_name = 'DA'
script_path = os.path.abspath('./Python/EEG_analysis')
data_path = os.path.abspath('./output_play/' + subject_name) 
os.path.exists(data_path + '/'+ subject_name + '.set') # The print out result is 'True'
raw = mne.io.read_raw_eeglab(input_fname = data_path + '/'+ subject_name + '.set')

Actual results

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-17-1519c0d84577> in <module>
----> 1 raw = mne.io.read_epochs_eeglab(input_fname = data_path + '/'+ subject_name + '_play_merged.set')

~/.pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/mne/io/eeglab/eeglab.py in read_epochs_eeglab(input_fname, events, event_id, eog, verbose, uint16_codec)
    277     epochs = EpochsEEGLAB(input_fname=input_fname, events=events, eog=eog,
    278                           event_id=event_id, verbose=verbose,
--> 279                           uint16_codec=uint16_codec)
    280     return epochs
    281 

<decorator-gen-198> in __init__(self, input_fname, events, event_id, tmin, baseline, reject, flat, reject_tmin, reject_tmax, montage, eog, verbose, uint16_codec)

~/.pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/mne/io/eeglab/eeglab.py in __init__(self, input_fname, events, event_id, tmin, baseline, reject, flat, reject_tmin, reject_tmax, montage, eog, verbose, uint16_codec)
    449                  uint16_codec=None):  # noqa: D102
    450         eeg = _check_load_mat(input_fname, uint16_codec)
--> 451 
    452         if not ((events is None and event_id is None) or
    453                 (events is not None and event_id is not None)):

~/.pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/mne/io/eeglab/eeglab.py in _check_load_mat(fname, uint16_codec)
     63             'mne-python developers for more information.')
     64     if 'EEG' not in eeg:
---> 65         raise ValueError('Could not find EEG array in the .set file.')
     66     else:
     67         eeg = eeg['EEG']

ValueError: Could not find EEG array in the .set file.

Additional information

I am using the latest version of EEGLAB(2021), so there might be some minor change in the .set file. This might be why I am faced with this error.

Thank you in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
arnodelormecommented, Feb 15, 2021

This is because, when saving in the root, it is possible to ignore some fields (such as “data”). In that case, we can load the metadata without loading the data, so there is no need to save 2 files anymore (.set and .fdt). We can just save one file. Simpler for users. EEGLAB in 2004 used to save files in this way as well so all versions of EEGLAB are already compatible with this format.

1reaction
MSA8D8commented, Mar 30, 2021

@cbrnr I uninstalled mne and install it again as @hoechenberger suggested. Then, the problem was finally solved !!!

Thank you for everything !! I really appriciate all of your kindly help !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

.set file import error - Support & Discussions - MNE Forum
raw = mne.io.read_raw_eeglab('Data/file.set', preload=True) , but I get this error ValueError: Could not find EEG array in the .set file.
Read more >
setting an array element with a sequence requested array has ...
ValueError : setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was ......
Read more >
Source code for mne_bids.utils - MNE-Python
if not op.exists(folder): raise ValueError('Directory does not exist: ... raise ValueError('Neither MEG/EEG/iEEG channels found in data.
Read more >
Data Loading
1.1) Loading datasets available in MNE: EEGBCI motor imagery Dataset ... This will load downloaded edf files and concatenate the raw data in...
Read more >
MNE : From raw data to epochs and evoked responses (ERF ...
The raw data do not need to fit in memory unless you want to filter continuous data (see below). In the introduction, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found