yusufsyaifudin / node-fasttext

A https://github.com/facebookresearch/fastText wrapper in nodeJS
5 stars 0 forks source link

libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector #3

Open bittlingmayer opened 7 years ago

bittlingmayer commented 7 years ago

I see the following error on predict, using the fastText pre-trained models, Node version v8.2.1.

ft = require('node-fasttext'); { train: [Function: train], printVectors: [Function: printVectors], modelInfo: [Function: modelInfo], test: [Function: test], predict: [Function: predict], path: '/Users/bittlingmayer/Desktop/ftn/node_modules/node-fasttext/build/Release/node-fasttext.node' }

ft.predict( ... "wiki.en.bin", 1, ... ['How are you?'], ... function (success, error) { ..... ... if(error) { ... console.log(error) ... return; ... } ... console.log(success) ... }) libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector Abort trap: 6

yusufsyaifudin commented 7 years ago

@bittlingmayer have you tried running the test script on your local machine, to ensure that test contains no errors.

$ # will download test data
$ ./test.sh
$ # will install mocha for testing
$ npm install -g mocha node-gyp
$ # will do the test
$ mocha test.js --timeout 18000000

I think it just because you are trying to predict using differents commit id of facebookresearch/fastText that I'm not used in this library. Are you do training using the latest commit from original repo then you predict using this library? Am I right?

If so, then just re-train your data and predict using this library only or if you are unsure about that, you can try train using fasttext with commit id 26e524e since from my commit id e3adbe6 I just using that version. Hope it will help.

PS: currently, I have no plan to support latest commit of facebookresearch/fasttext since I don't see it has a plan to make a stable relase, at least for now. Btw, you can make a PR if you want. :smiley: