Cannot load file containing pickled data when allow_pickle=False

Hi,

When i try to run the following code, it gives me this error.
‘ValueError: Cannot load file containing pickled data when allow_pickle=False’

with open(‘x_train.npy’, ‘wb’) as file:

  • file.write(X)*
    with open(‘y_train.npy’, ‘wb’) as file:
  • file.write(Y)*
    X = load(‘x_train.npy’)

And I tried by adding another parameter by setting pickle True.

with open(‘x_train.npy’, ‘wb’) as file:

  • file.write(X)*
    with open(‘y_train.npy’, ‘wb’) as file:
  • file.write(Y)*
    X = load(‘x_train.npy’,allow_pickle=True)

But now I’m facing new error:

‘OSError: Failed to interpret file ‘x_train.npy’ as a pickle’
‘ValueError: could not convert string to int’

I tried with lot of things. But could not find the answer.
Can you help me in solving this issue.

File downloaded:
X = download_data(‘https://studio.edgeimpulse.com/v1/api/32096/training/5/x’)

Also I have couple of questions:

  1. How the 2d array coming from MFE or MFCC been converted to npy file. Can you share couple of sources that helps us in understanding more.
  2. How the mfe array of 100files are compressed to one single npy file.

Hey, which numpy version do you have? I have numpy==1.19.0 and that opens the files right (exported your project as an iPython notebook)…

On 2) we create a matrix with each row being one sample. In your case 7000x3168 (7000 samples, 3168 features per sample).