ValueError: mmap length is greater than file size

Hi, i am trying to create a simple motion classification model but when i am trying to generate the features i am getting the error below:

Creating job… OK (ID: 1482704)

Scheduling job in cluster…
Job started
Creating windows from 116 files…
[ 2/58] Pre-caching files…
[58/58] Pre-caching files…
Pre-caching files OK

[ 1/116] Creating windows from files…
[116/116] Creating windows from files…
Created 9456 windows: jumping-jacks: 2624, push-ups: 1316, standing: 1412, stay-hydrated: 1870, walking: 2234

Traceback (most recent call last):
File “/home/”, line 22, in
X_train = np.load(inFileX, mmap_mode=‘r’)
File “/usr/local/lib/python3.7/dist-packages/numpy/lib/”, line 450, in load
return format.open_memmap(file, mode=mmap_mode)
File “/usr/local/lib/python3.7/dist-packages/numpy/lib/”, line 869, in open_memmap
mode=mode, offset=offset)
File “/usr/local/lib/python3.7/dist-packages/numpy/core/”, line 264, in new
mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
ValueError: mmap length is greater than file size

Application exited with code 1 (Error)

Job failed (see above)

Thank you

@ahadji08 I’m investigating!

@ahadji08 Two of your files have invalid values in the payload. E.g. see this:


These are files:

  • walking.5
  • jumping-jacks.4

How did you generate these files? With what device? Would like to dive into this and see if we have a bug somewhere…

I’ll also make sure we don’t error out and show a proper warning highlighting these files in the Studio.

1 Like

@janjongboom First of all thank you for your time and your help. I will delete those files and see how it does now.

The data are generated through edge impulse data acquisition using my STMicroelectronics B-L475E-IOT01A1 board. The board is connected to another project. Hence, i took the data on the other project and copy them to a new project. To be honest while i was taking the data sometimes (like every 15-20 samples/files) a message was appear about not able to take the data or was just loading at the point of waiting movement to start sampling. For that problem i had to restart the device and start again. I did that like 4-5 times until i get all the 74 files or 10 minutes of data that I wanted.

Thank you again!

1 Like