Code Monkey home page Code Monkey logo

Comments (5)

syl22-00 avatar syl22-00 commented on September 13, 2024

I understand the errors you mention are compile-time errors, not errors reported by the browser, right?
To answer your questions:

  • Compilation is quick. However, at the end of compilation, if you package model files inside your JavaScript files, it converts them do text data, and that might take a little longer.
  • TOTAL_MEMORY is an emscripten setting to set the virtual memory size of the JavaScript processes, so it has nothing to do with compilation.
  • It is definitely a good practice to do out-of-tree compilation. In a build folder, or however you want to name it. Note the .. at the end of the cmake invocation to point to the location to CMakeLists.txt.

And I would very warmly recommend to package your model files outside pocketsphinx.js as explained in the docs. In addition, it would give you more information of what fails (compilation vs. encoding of model files).

If I were you I would follow how memory gets used with top and/or free, and possibly create a swap partition.

from pocketsphinx.js.

peveuve avatar peveuve commented on September 13, 2024

yes, it's compilation-time error.
Thanks for pointing the .. at the end of the cmake line, I didn't notice that!
Do you recommend not to package even the accoustic model? What is the reason for that?
I believe browsers prefer sending one big request rather than several small ones.
And I have a 1Gb swap partition.

from pocketsphinx.js.

peveuve avatar peveuve commented on September 13, 2024

OK, so first I successfully compiled pocketsphinx without packaging anything with (HMM_EMBED=OFF), then I tried packaging the am, lm and dict files in separate js.
It fails when packing the french language model (250Mb) with an out of memory error.
The error message clearly says the python script ate the whole memory and swap (4Gb + 1Gb):

Killed process 3508 (python) total-vm:4904444Kb, anon-rss:3791864Kb, file-rss:44Kb

the command was:
sudo python .../file_packages.py ../build/pocketsphinx.js --embed french3g62K.lm.dmp --js-output=french3g62K.lm.js

Any idea is welcome!

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024
  • How about just increasing your swap then?
  • Any reason why you run the packaging command as root?
  • For your earlier question: as files are large request time is negligible, and separating data files and program makes sure your data files remain cached even if you update the recognizer code (pocketsphinx.js).

from pocketsphinx.js.

peveuve avatar peveuve commented on September 13, 2024

5Gb of memory is not enough to package a 250Mb file? Sounds weird.

Actually, the process failed but generated an incomplete 1Gb js file. 250Mb was already a very big file, but 1Gb, it's just too much for downloading with a regular ADSL connection.
Seeing the size of the resulting file and the amount of memory necessary, I would tend to think the packaging process has a problem.

Anyhow, I will search for a smaller grammar for my test, loading a generic grammar is just too much at the moment.

To answer your second question, no particular reason to use the root user, but I guess it doesn't matter.
And thanks for your explanation, it makes sense.

from pocketsphinx.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.