NeuroTechX / moabb

Mother of All BCI Benchmarks
https://neurotechx.github.io/moabb/
BSD 3-Clause "New" or "Revised" License
689 stars 179 forks source link

Change the directory of download datasets has a problem when you try to do an Evaluation or other examples #431

Closed bzorzet98 closed 1 year ago

bzorzet98 commented 1 year ago

Hi, how are you? I am Bruno ZOrzet, Iam a PhD student, I'm working on BCI and my co-advisor Victoria Peterson (@vpeterson) showed me the framework. I've worked with this for 2 weeks ago. So I did this actions:

  1. I change the download path with the code change_download_directory.py, it's and example on https://neurotechx.github.io/moabb/auto_examples/changing_download_directory.html. I change the path. That it's okey.
  2. After that, I work on my code and I do this: ` from moabb.paradigms import MotorImagery from moabb.datasets import * from moabb.evaluations import WithinSessionEvaluation

    Parse the arguments from the command line

    args = parser.parse_args()

if args.finetune_db == 'Lee2019_MI': datasets = [Lee2019_MI()] elif args.finetune_db == 'Cho2017': datasets = [Cho2017()] else: raise ValueError('Invalid pretrained database name') paradigm = MotorImagery( channels=['C3', 'Cz', 'C4'], # Same as the ones used to pre-train the embedding events=['left_hand', 'right_hand'], n_classes=2, fmin=0.5, fmax=40, tmin=0, tmax=3, resample=128, ) evaluation = WithinSessionEvaluation( paradigm=paradigm, datasets=datasets, overwrite=True, suffix='demo', )`

When I run the code I obtain the follow issue: "I have this error: Exception has occurred: FileNotFoundError Download location /home/bzorzet/mne_data as specified by MNE_DATA does not exist. Either create this directory manually and try again, or set MNE_DATA to an existing directory. File "/home/bzorzet/Academico/Doctorado/DeepBCI/fine_tunning_EEGNetv4_baseline.py", line 175, in evaluation = WithinSessionEvaluation( FileNotFoundError: Download location /home/bzorzet/mne_data as specified by MNE_DATA does not exist. Either create this directory manually and try again, or set MNE_DATA to an existing directory"

In summary, the issue tell me that /home/bzorzet/mne_data doesn't exist. So I debbug the issue an find that in the implementation of the class Results we have this code:

if hdf5_path is None: if get_config("MOABB_RESULTS") is None: set_config("MOABB_RESULTS", osp.join(osp.expanduser("~"), "mne_data")) self.mod_dir = _get_path(None, "MOABB_RESULTS", "results")

So when you use the lines osp.join(osp.expanduser("~"), "mne_data") that comand define the path but not create the path. So I resolve the issue change the directory of MOABB_RESULTS in the same place that MNE_DATA.

I resolve in this way, I don't know if it is the best option. But how I think that this framework has a future I want to help. I have other ideas of how can implement the train/val/test models, to do that more flexible for pytorch users like me, but maybe we discuss this in other time.

bruAristimunha commented 1 year ago

Hello @bzorzet98!

About your issue, my quick answer:

Can you clear the mne cache and try again?

Something like this: rm -r .mne in your home directory. It's a hidden folder created by the mne.

bzorzet98 commented 1 year ago

Hi, no I don't clear the cache. But now my code works, just I have to change manually the path of MOABB_RESULTS.

El jue, 27 de jul de 2023, 11:31 a. m., Bru @.***> escribió:

Hello @bzorzet98 https://github.com/bzorzet98!

About your issue, my quick answer:

Can you clear the mne cache and try again?

Something like this: rm -r .mne in your home directory. It's a hidden folder created by the mne.

— Reply to this email directly, view it on GitHub https://github.com/NeuroTechX/moabb/issues/431#issuecomment-1653742352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQQBF2C4EXDV7UG7USV73TXSJ3T7ANCNFSM6AAAAAA22EMLDU . You are receiving this because you were mentioned.Message ID: @.***>