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

ValueError: mmap length is greater than file size #198

Open
maciejmajek opened this issue Aug 30, 2024 · 0 comments · May be fixed by #199
Open

ValueError: mmap length is greater than file size #198

maciejmajek opened this issue Aug 30, 2024 · 0 comments · May be fixed by #199

Comments

@maciejmajek
Copy link

When running the automatic_model_training.ipynb locally, I've come across a problem with the training script --train_model.
I was able to solve this by adding + to the mmap_mode.

self.data = {label: np.load(fl, mmap_mode='r+') for label, fl in data_files.items()}

env:
python3.10

Stack trace

File "openwakeword/openwakeword/train.py", line 845, in
batch_generator = mmap_batch_generator(
File "/home/mmajek/projects/internal/rai/openwakeword/openwakeword/data.py", line 788, in init
self.data = {label: np.load(fl, mmap_mode='r') for label, fl in data_files.items()}
File "/home/mmajek/projects/internal/rai/openwakeword/openwakeword/data.py", line 788, in
self.data = {label: np.load(fl, mmap_mode='r') for label, fl in data_files.items()}
File "/home/mmajek/.cache/pypoetry/virtualenvs/rai-qH6Oly3A-py3.10/lib/python3.10/site-packages/numpy/lib/npyio.py", line 453, in load
return format.open_memmap(file, mode=mmap_mode,
File "/home/mmajek/.cache/pypoetry/virtualenvs/rai-qH6Oly3A-py3.10/lib/python3.10/site-packages/numpy/lib/format.py", line 945, in open_memmap
marray = numpy.memmap(filename, dtype=dtype, shape=shape, order=order,
File "/home/mmajek/.cache/pypoetry/virtualenvs/rai-qH6Oly3A-py3.10/lib/python3.10/site-packages/numpy/core/memmap.py", line 268, in new
mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
ValueError: mmap length is greater than file size

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

Successfully merging a pull request may close this issue.

1 participant