Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.08k stars 997 forks source link

Error when running `node microphone.js`: node: symbol lookup error: /home/pi/snowboytest/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-x64/snowboy.node: undefined symbol: cblas_sdot #61

Closed tiny-tinker closed 7 years ago

tiny-tinker commented 7 years ago

Ok, so I set up a new Debian x64 box and installed node v6.7.0:

$ node --version
v6.7.0

Then did:

cd
mkdir snowboytest
npm install --save snowboy

Everything installed successfully as far as I could tell. So based on the example, I came up with this code with the appropriate directories changed:

const record = require('node-record-lpcm16');
const snowboy = require( 'snowboy' );
//const {Detector, Models} = require('../../');

const Detector = snowboy.Detector;
const Models   = snowboy.Models;

const models = new Models();

models.add({
  file: './node_modules/snowboy/resources/snowboy.umdl',
  sensitivity: '0.5',
  hotwords : 'snowboy'
});

const detector = new Detector({
  resource: "./node_modules/snowboy/resources/common.res",
  models: models,
  audioGain: 2.0
});

detector.on('silence', function () {
  console.log('silence');
});

detector.on('sound', function () {
  console.log('sound');
});

detector.on('error', function () {
  console.log('error');
});

detector.on('hotword', function (index, hotword) {
  console.log('hotword', index, hotword);
});

const mic = record.start({
  threshold: 0,
  verbose: true
});

mic.pipe(detector);

But when I run it:


pi@alphared-agent-virtual2:~/snowboytest$ 
pi@alphared-agent-virtual2:~/snowboytest$ node microphone.js 
Recording with sample rate 16000...
Recording 12288 bytes
node: symbol lookup error: /home/pi/snowboytest/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-x64/snowboy.node: undefined symbol: cblas_sdot

I'm not sure if it is related or not, but when running the examples directly, I got an error trying to find the file..:

pi@alphared-agent-virtual2:~/snowboy/node_modules$ cd snowboy/examples/Node/
pi@alphared-agent-virtual2:~/snowboy/node_modules/snowboy/examples/Node$ node microphone.js 
/home/pi/snowboy/node_modules/snowboy/lib/node/index.js:27
            throw new Error(`Model ${model.file} does not exists.`);
            ^

Error: Model resources/snowboy.umdl does not exists.
    at HotwordModels.add (/home/pi/snowboy/node_modules/snowboy/lib/node/index.js:27:19)
    at Object.<anonymous> (/home/pi/snowboy/node_modules/snowboy/examples/Node/microphone.js:6:8)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
causztic commented 7 years ago

@nomadic-squirrel When running the examples directly, for now, you need to manually change the file address from resources/snowboy.umdl and resources/common.res to ../../resources/snowboy.umdl and ../../resources/common.res for now, until they've updated the example.

chenguoguo commented 7 years ago

Since you are using Linux, please make sure you run this command sudo apt-get install libmagic-dev libatlas-base-dev. Also, this issue has been fixed, but we haven't published the fixed version, so you might want to try the local development version.

evancohen commented 7 years ago

@chenguoguo I would recommend republishing the linux node binary for v1.1.0. This won't force you to incrament the module version, but will let you hotfix the binary (this is why I built in republishing for Travis).

chenguoguo commented 7 years ago

Republishing is done, but I don't have a ubuntu machine machine to test by hand; @nomadic-squirrel could you give it a shot and see if it works now?

tdg5 commented 7 years ago

I'm running Ubuntu 16.04 with Node 6.8.0 and I can confirm that once all the dependencies are in place node microphone.js works on the current version of master (549fc4c7ea7e471d12b92b9c3c8c963271054de1). :tada:

chenguoguo commented 7 years ago

Closing this since the issue has been resolved.