You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MNE doc, it is said that the "events" parameter of mne.Info objects is a list of dicts with "channels" and "list" keys.
The "list" key points to the ndarray containing the events.
So I think that this line could be replaced by something like :
This issue creates problems when trying to save the dataset :
File "<decorator-gen-183>", line 20, in save
File "/home/pguetsch/.local/lib/python3.8/site-packages/mne/epochs.py", line 1638, in save
_save_split(this_epochs, fname, part_idx, n_parts, fmt)
File "/home/pguetsch/.local/lib/python3.8/site-packages/mne/epochs.py", line 104, in _save_split
write_meas_info(fid, info)
File "/home/pguetsch/.local/lib/python3.8/site-packages/mne/io/meas_info.py", line 1507, in write_meas_info
if event.get('channels') is not None:
AttributeError: 'numpy.ndarray' object has no attribute 'get'
I see. Definitely an issue, but I wonder whether mne is only complaining when writing the data to a file or there are also issues during epoching or other processing in the core MOABB application.
I have a look as well. What is causing this error is lines 249-252 of schirrmeister2017 when commented everything works (currently check whether removing/commenting these lines will effect moabb, I'll update you soon). However, raw.info['events'] is empty (i.e. []). I tried to see whether this is caused by raw.add_channels. However, this is not the case as even when adding it directly while creating RawArray creates an empty list in raw.info['events']. Does anyone know what mne uses raw.info['events']? Maybe when using Annotations, not stim channels.
Update: commenting/removing 249-252 lines, do not change the Evaluation results for WithSessionEvaluation and CrossSubjectEvaluation (Note that CrossSessionEvaluation can't be done since this dataset contain only one session).
Ok, I tried the fix from @PierreGtch that works well. No need to comment out lines 249-252 as you proposed @AliAbdulHussain. Even if it does not change the outcomes of evaluation, the code fix from @PierreGtch allows a better handling of the events that could be useful in the future.
Activity
jsosulski commentedon Mar 18, 2021
What do you mean with saving the dataset? When the results are created or when saving raw data?
PierreGtch commentedon Mar 18, 2021
I mean when saving raw data
Here is a minimal example :
And the output :
Also, here are the version I have installed :
jsosulski commentedon Mar 18, 2021
I see. Definitely an issue, but I wonder whether mne is only complaining when writing the data to a file or there are also issues during epoching or other processing in the core MOABB application.
PierreGtch commentedon Mar 18, 2021
yes I don't know either
But this seems to fix the saving part at least :
sylvchev commentedon Mar 18, 2021
Thanks for the investigation! I'll check, but I think this occur only for Schirrmeister dataset. Could you confirm @PierreGtch ?
PierreGtch commentedon Mar 18, 2021
AliAbdulHussain commentedon Mar 18, 2021
I have a look as well. What is causing this error is lines 249-252 of schirrmeister2017 when commented everything works (currently check whether removing/commenting these lines will effect moabb, I'll update you soon). However, raw.info['events'] is empty (i.e. []). I tried to see whether this is caused by raw.add_channels. However, this is not the case as even when adding it directly while creating RawArray creates an empty list in raw.info['events']. Does anyone know what mne uses raw.info['events']? Maybe when using Annotations, not stim channels.
Update: commenting/removing 249-252 lines, do not change the Evaluation results for WithSessionEvaluation and CrossSubjectEvaluation (Note that CrossSessionEvaluation can't be done since this dataset contain only one session).
sylvchev commentedon Jan 21, 2022
Ok, I tried the fix from @PierreGtch that works well. No need to comment out lines 249-252 as you proposed @AliAbdulHussain. Even if it does not change the outcomes of evaluation, the code fix from @PierreGtch allows a better handling of the events that could be useful in the future.