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.1k stars 1k forks source link

ERROR (ExpectToken():snowboy-io.cc:166) Expected token "<KwInfo>", got instead "<LicenseStart>". #241

Open liuzqt opened 7 years ago

liuzqt commented 7 years ago

I'm using Mac os 10.12.5 with python2.7
when I run the demo.py, got this exception. seems like a C++ error

ERROR (ExpectToken():snowboy-io.cc:166) Expected token "<KwInfo>", got instead "<LicenseStart>".
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: ERROR (ExpectToken():snowboy-io.cc:166) Expected token "<KwInfo>", got instead "<LicenseStart>".

[stack trace: ]
0   _snowboydetect.so                   0x000000010bc8806e _ZN7snowboy13GetStackTraceEv + 94
1   _snowboydetect.so                   0x000000010bc88d45 _ZN7snowboy13SnowboyLogMsgD2Ev + 421
2   _snowboydetect.so                   0x000000010bc8af24 _ZN7snowboy11ExpectTokenEbPKcPNSt3__113basic_istreamIcNS2_11char_traitsIcEEEE + 1012
3   _snowboydetect.so                   0x000000010bc645e6 _ZN7snowboy21UniversalDetectStream16ReadHotwordModelERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 2438
4   _snowboydetect.so                   0x000000010bc6327d _ZN7snowboy21UniversalDetectStreamC2ERKNS_28UniversalDetectStreamOptionsE + 1261
.
.
.
28  libpython2.7.dylib                  0x000000010b84a2e6 PyEval_EvalCode + 54
29  libpython2.7.dylib                  0x000000010b879254 PyRun_FileExFlags + 164
30  libpython2.7.dylib                  0x000000010b878dd1 PyRun_SimpleFileExFlags + 769
31  libpython2.7.dylib                  0x000000010b88ea12 Py_Main + 3154
32  python                              0x000000010b799f24 start + 52

[1]    1256 abort      python demo.py
chenguoguo commented 7 years ago

Where did you get your model? Looks like your model has license attached to it, and if that is the case, we should have sent you a updated decoder offline.

rench commented 7 years ago

NanoPi NEO Plus2 has the same error while using lib/aarch64-ubuntu1604/libsnowboy-detect.a.

pi@NanoPi-NEO-Plus2:~/pro/node/dcs-sdk-js/snowboy$ node ../index.js 
ERROR (ExpectToken():snowboy-io.cc:166) Expected token "<KwInfo>", got instead "<LicenseStart>".
terminate called after throwing an instance of 'std::runtime_error'
  what():  ERROR (ExpectToken():snowboy-io.cc:166) Expected token "<KwInfo>", got instead "<LicenseStart>".

[stack trace: ]
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(_ZN7snowboy13GetStackTraceEv+0x60) [0xffff86f962fc]
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(_ZN7snowboy13SnowboyLogMsgD1Ev+0x4ac) [0xffff86f96944]
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(_ZN7snowboy11ExpectTokenEbPKcPSi+0x19c) [0xffff86fa23c4]
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(_ZN7snowboy21UniversalDetectStream16ReadHotwordModelERKSs+0x7c8) [0xffff86fbd638]
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(_ZN7snowboy21UniversalDetectStreamC2ERKNS_28UniversalDetectStreamOptionsE+0x500) [0xffff86fbf70c]
.
.
.
/home/pi/pro/node/dcs-sdk-js/snowboy/lib/node/binding/Release/node-v57-linux-arm64/snowboy.node(+0x1ceac) [0xffff86f7feac]
node(_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+0x164) [0xb52cb4]
node() [0xbca788]
node(_ZN2v88internal21Builtin_HandleApiCallEiPPNS0_6ObjectEPNS0_7IsolateE+0xbc) [0xbcadf4]
[0x27204108]

Aborted
pi@NanoPi-NEO-Plus2:~/pro/node/dcs-sdk-js/snowboy$ 
chenguoguo commented 7 years ago

which model are you using? If you are using our public models, you are not supposed to see those errors.

bacek commented 6 years ago

I have same issue with public jarvis.umdl.

chenguoguo commented 6 years ago

Very wired. I just tried the following and it works:

  1. Checkout out the repository

  2. Make under swig/Python, cd swig/Python; make

  3. Enter examples/Python and apply the following patch for the jarvis.umdl setting

    
    diff --git a/examples/Python/demo.py b/examples/Python/demo.py
    index 305b8b6..7d7caf4 100644
    --- a/examples/Python/demo.py
    +++ b/examples/Python/demo.py
    @@ -24,7 +24,9 @@ model = sys.argv[1]
    # capture SIGINT signal, e.g., Ctrl+C
    signal.signal(signal.SIGINT, signal_handler)

-detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5) +detector = snowboydecoder.HotwordDetector(model,

Then run it python demo.py resources/models/jarvis.umdl

bacek commented 6 years ago

I'm using node.js bindings (1.2). Probably related to https://github.com/Kitt-AI/snowboy/issues/341#issuecomment-364838771

chenguoguo commented 6 years ago

Yes you have to use 1.3 or above; or you can compile your own node bindings. @bacek

bacek commented 6 years ago

Unfortunately 1.3 node bindings crashing on loading model (any model) with error on funmap. And I didn't have time to investigate it.