dialogflow / asr-server

FastCGI support for Kaldi ASR
Apache License 2.0
184 stars 86 forks source link

Error with my own Model #7

Closed sameerkhurana10 closed 7 years ago

sameerkhurana10 commented 8 years ago

Hi,

I am getting the following error when I use my own model.

{"status":"error","data":[{"text":"Assertion failed: features.NumCols() == mfcc_dim + ivectordim && "Mismatch in features dim" Stack trace is: kaldi::KaldiGetStackTrace() kaldi::KaldiAssertFailure(char const, char const, int, char const) kaldi::nnet3::DecodableNnet3SimpleOnline::ComputeForFrame(int) kaldi::nnet3::DecodableNnet3SimpleOnline::LogLikelihood(int, int) kaldi::LatticeFasterOnlineDecoder::ProcessEmitting(kaldi::DecodableInterface) kaldi::LatticeFasterOnlineDecoder::AdvanceDecoding(kaldi::DecodableInterface, int) kaldi::SingleUtteranceNnet3Decoder::AdvanceDecoding() apiai::Nnet3LatgenFasterDecoder::AcceptWaveform(float, kaldi::VectorBase const&, bool) apiai::OnlineDecoder::Decode(apiai::Request&, apiai::Response&) apiai::FcgiDecodingApp::ProcessingRoutine(apiai::Decoder&) apiai::FcgiDecodingApp::Run(int, char*) ../asr-server/fcgi-nnet3-decoder(main+0x5f) [0x8267cc] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f821c563f45] ../asr-server/fcgi-nnet3-decoder() [0x8266a9]

[stack trace: ] kaldi::KaldiGetStackTrace() kaldi::MessageLogger::~MessageLogger() kaldi::KaldiAssertFailure(char const, char const, int, char const) kaldi::nnet3::DecodableNnet3SimpleOnline::ComputeForFrame(int) kaldi::nnet3::DecodableNnet3SimpleOnline::LogLikelihood(int, int) kaldi::LatticeFasterOnlineDecoder::ProcessEmitting(kaldi::DecodableInterface) kaldi::LatticeFasterOnlineDecoder::AdvanceDecoding(kaldi::DecodableInterface, int) kaldi::SingleUtteranceNnet3Decoder::AdvanceDecoding() apiai::Nnet3LatgenFasterDecoder::AcceptWaveform(float, kaldi::VectorBase const&, bool) apiai::OnlineDecoder::Decode(apiai::Request&, apiai::Response&) apiai::FcgiDecodingApp::ProcessingRoutine(apiai::Decoder&) apiai::FcgiDecodingApp::Run(int, char_*) ../asr-server/fcgi-nnet3-decoder(main+0x5f) [0x8267cc] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f821c563f45] ../asr-server/fcgi-nnet3-decoder() [0x8266a9]

"}]}

My model is trained using MFCC + I-Vectors. It is the chain-tdnn model. mfcc.conf file looks like:

--use-energy=false # use average of log energy, not energy. --sample-frequency=16000 # Switchboard is sampled at 8kHz --num-mel-bins=40 # similar to Google's setup. --num-ceps=40 # there is no dimensionality reduction. --low-freq=40 # low cutoff frequency for mel bins --high-freq=-200 # high cutoff frequently, relative to Nyquist of 4000 (=3800)

I believe the error is due to using mfcc+i-vectors. is there a quick fix for this?

realill commented 8 years ago

Yes this is ivecotor support issue.

It should be super easy to fix. @folomeev do we use copy-paste decoder here, or do we reuse original kaldi one?

@sameerkhurana10 if you manage to fix this on your own, please send us pull-request.

folomeev commented 8 years ago

We use a part of code copied from online-nnet3-decoding.cc and there is no iVectors support in the used part.

To fix the issue the missing code should be added. It is not actually hard-to-do task but I can't name it a quick fix.

realill commented 8 years ago

@folomeev kaldi already support this in main branch. We should avoid copy-paste, and just reuse kaldi decoder directly.