Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickle Error loading the *.npy data #2

Closed
martinwimpff opened this issue Apr 19, 2023 · 4 comments
Closed

Pickle Error loading the *.npy data #2

martinwimpff opened this issue Apr 19, 2023 · 4 comments

Comments

@martinwimpff
Copy link

I downloaded the dataset and tried to run the _00_getting_started.ipynb script.
I get an error while trying to load the *.npy files via load_bids()
If I use data = np.load(fname_eeg) I get the error:
ValueError: Cannot load file containing pickled data when allow_pickle=False
If I set allow_pickle=True I get the error:
_pickle.UnpicklingError: Failed to interpret file '...' as a pickle

This thread suggests that the file is corrupted.

Any ideas?

@ezemikulan
Copy link
Member

Hi, I don't think the file is corrupted as many people have used it without problems and I've just re-checked and I can read the files as usual.

It looks like the filename is not correct as it says "Failed to interpret file '...' as a pickle". The file shouldn't be '...'. Can you paste a reproducible example?

It should load If you do this in the folder where the file is:

import numpy as np
data = np.load('sub-01_task-seegstim_run-01_epochs.npy')

@martinwimpff
Copy link
Author

Hi, thanks for the fast response!

The link is not the problem, I just inserted those ... to avoid pasting an unecessary long path.
A very minimal example can be found here.

I downloaded the data as a zip file, extracted it and then uploaded the file to colab.

@ezemikulan
Copy link
Member

Thanks, then it looks like a file corruption during transfer to me. Also, are you using the latest version of the dataset?

Please re-download it from here: https://gin.g-node.org/ezemikulan/Localize-MI and try again.

You can download only one file if you prefer:

https://gin.g-node.org/ezemikulan/Localize-MI/src/master/derivatives/epochs/sub-07/eeg/sub-07_task-seegstim_run-07_epochs.npy

@martinwimpff
Copy link
Author

Sorry, i didn't read this "Annexed files (by default, files larger than 10 MB) will be included as pointer files (stubs) but the data will not be included. To get the content of the big files you need to download them individually from this web page."
Just wasn't familiar with the workflow.
Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants