mozilla / DeepSpeech

DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers.
Mozilla Public License 2.0
25.1k stars 3.94k forks source link

Bug : Swift Code crash while running #3664

Open XI1868-manishjain opened 3 years ago

XI1868-manishjain commented 3 years ago

Swift code keep crashing.I run swift app comes with repo on iPhone 8 and it crashes with following logs

TensorFlow: v2.2.0-24-g1c1b2b9dd9
DeepSpeech: v0.8.2-0-g02e4c762
2021-06-19 19:48:33.542444+0530 deepspeech_ios_test[3827:544431] Initialized TensorFlow Lite runtime.
libc++abi: terminating with uncaught exception of type util::ErrnoException: native_client/kenlm/util/mmap.cc:122 in void *util::MapOrThrow(std::size_t, bool, int, bool, int, uint64_t) threw ErrnoException because `(ret = mmap(__null, size, protect, flags, fd, offset)) == ((void *)-1)'.
Cannot allocate memory mmap failed for size 941209108 at offset 0
terminating with uncaught exception of type util::ErrnoException: native_client/kenlm/util/mmap.cc:122 in void *util::MapOrThrow(std::size_t, bool, int, bool, int, uint64_t) threw ErrnoException because `(ret = mmap(__null, size, protect, flags, fd, offset)) == ((void *)-1)'.
Cannot allocate memory mmap failed for size 941209108 at offset 0

For support and discussions, please use our Discourse forums.

If you've found a bug, or have a feature request, then please create an issue with the following information:

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Please describe the problem clearly. Be sure to convey here why it's a bug or a feature request.

Include any logs or source code that would be helpful to diagnose the problem. For larger logs, link to a Gist, not a screenshot. If including tracebacks, please include the full traceback. Try to provide a reproducible test case.

weipin commented 3 years ago

I don't think iPhone 8 has enough memory to hold the entire model files. You may want to give the modern ones a try (iPhone 10+).