alumae / gst-kaldi-nnet2-online

GStreamer plugin around Kaldi's online neural network decoder
Apache License 2.0
185 stars 100 forks source link

fix nnet3 cannot decode at frist of utterances #85

Closed chrisngyn closed 5 years ago

chrisngyn commented 5 years ago

When i using nnet3 for decode, I realized there was a gap between the utterances. I found out that after endpointing detection, they create a new feature_pipline for next utterance. Then, there are few first frames of new utterance in previous feature_pipline was ignored. So, I fixed it by using just one feature_pipline for the whole audio.

alumae commented 5 years ago

Thanks!

alumae commented 5 years ago

I had to roll this back, as it doesn't compile:

g++ -std=c++11 -I.. -isystem /home/tanel/tools/kaldi-trunk/tools/openfst/include -O1 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/glib
-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE
_MKL -I/opt/intel/mkl/include -m64 -msse -msse2 -pthread -g  -fPIC -I/home/tanel/tools/kaldi-trunk/src   -c -o gstkaldinnet2onlinedecoder.o gstkaldinnet2onlinedecoder.cc                                          
gstkaldinnet2onlinedecoder.cc: In function ‘void kaldi::gst_kaldinnet2onlinedecoder_nnet3_unthreaded_decode_segment(kaldi::Gstkaldinnet2onlinedecoder*, bool&, int32, kaldi::BaseFloat)’:
gstkaldinnet2onlinedecoder.cc:1516:13: error: ‘kaldi::SingleUtteranceNnet3Decoder {aka class kaldi::SingleUtteranceNnet3DecoderTpl<fst::Fst<fst::ArcTpl<fst::TropicalWeightTpl<float> > > >}’ has no member named ‘
InitDecoding’; did you mean ‘AdvanceDecoding’?                                                                                                                                                                     
     decoder.InitDecoding(frame_offset);                                                                 
             ^~~~~~~~~~~~                                           
             AdvanceDecoding                                                  
gstkaldinnet2onlinedecoder.cc:1539:26: error: ‘class kaldi::OnlineNnet2FeaturePipeline’ has no member named ‘UpdateFrameWeights’
         feature_pipeline.UpdateFrameWeights(delta_weights,                                                                     
                          ^~~~~~~~~~~~~~~~~~                                          
<builtin>: recipe for target 'gstkaldinnet2onlinedecoder.o' failed          
chrisngyn commented 5 years ago

Those missing methods are only available in kaldi 5.5. So try rebuilding with kaldi 5.5 to fix this.

alumae commented 5 years ago

Thanks, will try.