使用来自GStreamer的铝材插件和以下管道:
appsrc source='appsrc' ! wavparse ! audioconvert ! audioresample ! queue ! kaldinnet2onlinedecoder <parameters snipped> ! filesink location=/tmp/test
我总是得到以下断言:我不理解KALDI_ASSERT(current_log_post_.NumRows() == info_.frames_per_chunk / info_.opts.frame_subsampling_factor && current_log_post_.NumCols() == info_.output_dim);
断言错误是关于什么的?怎么修呢?
FYI,推入管道的数据来自流wav文件,并将kaldinnetonlinedecoder替换为Wav正确地生成一个Wav文件,而不是最后的文本文件。
编辑这里使用的参数如下:
use-threaded-decoder=0
model=/opt/en/final.mdl
word-syms=<word-file>
fst=<fst_file>
mfcc-config=<mfcc-file>
ivector-extraction-config=/opt/en/ivector-extraction/ivector_extractor.conf
max-active=10000
beam=10.0
lattice-beam=6.0
do-endpointing=1
endpoint-silence-phones=\"1:2:3:4:5:6:7:8:9:10\"
traceback-period-in-secs=0.25
num-nbest=10 关于您的信息,在python中使用管道文本表示可以工作,但是编写代码(即使用Gst.Element_Factory.make等)总是抛出异常。
第二次更新这里是断言生成的完整堆栈跟踪
ASSERTION_FAILED ([5.2]:AdvanceChunk():decodable-online-looped.cc:223) : 'current_log_post_.NumRows() == info_.frames_per_chunk / info_.opts.frame_subsampling_factor && current_log_post_.NumCols() == info_.output_dim'
[ Stack-Trace: ]
kaldi::MessageLogger::HandleMessage(kaldi::LogMessageEnvelope const&, char const*)
kaldi::MessageLogger::~MessageLogger()
kaldi::KaldiAssertFailure_(char const*, char const*, int, char const*)
kaldi::nnet3::DecodableNnetLoopedOnlineBase::AdvanceChunk()
kaldi::nnet3::DecodableNnetLoopedOnlineBase::EnsureFrameIsComputed(int)
kaldi::nnet3::DecodableAmNnetLoopedOnline::LogLikelihood(int, int)
kaldi::LatticeFasterOnlineDecoder::ProcessEmitting(kaldi::DecodableInterface*)
kaldi::LatticeFasterOnlineDecoder::AdvanceDecoding(kaldi::DecodableInterface*, int)
kaldi::SingleUtteranceNnet3Decoder::AdvanceDecoding()发布于 2018-01-23 16:21:19
我终于让它工作了,即使是帧-次采样-因子参数。
问题在于参数的顺序。fst和模型参数必须是最后的参数。
因此,以下文本链起作用:
gst-launch-1.0 pulsesrc device=alsa_input.pci-0000_00_05.0.analog-stereo ! queue ! \
audioconvert ! \
audioresample ! tee name=t ! queue ! \
kaldinnet2onlinedecoder \
use-threaded-decoder=0 \
nnet-mode=3 \
word-syms=/opt/models/fr/words.txt \
mfcc-config=/opt/models/fr/mfcc_hires.conf \
ivector-extraction-config=/opt/models/fr/ivector-extraction/ivector_extractor.conf \
phone-syms=/opt/models/fr/phones.txt \
frame-subsampling-factor=3 \
max-active=7000 \
beam=13.0 \
lattice-beam=8.0 \
acoustic-scale=1 \
do-endpointing=1 \
endpoint-silence-phones=1:2:3:4:5:16:17:18:19:20 \
traceback-period-in-secs=0.25 \
num-nbest=2 \
chunk-length-in-secs=0.25 \
fst=/opt/models/fr/HCLG.fst \
model=/opt/models/fr/final.mdl \
! filesink async=0 location=/dev/stdout t. ! queue ! autoaudiosink async=0为此,我打开了问题 on GitHub,因为对我来说,这是很难找到的,至少应该有文档记录。
https://stackoverflow.com/questions/47471250
复制相似问题