alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.38k stars 1.04k forks source link

Generating final.ext.raw from final.raw but got ASSERTION_FAILED #1444

Closed Natphitchayuk closed 9 months ago

Natphitchayuk commented 9 months ago

I have already extracted the model with extract.config but it still got this error

WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node tdnn6.relu is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node tdnn6.batchnorm is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node tdnn7.affine is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node tdnn7.relu is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node tdnn7.batchnorm is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node output.affine is never used to compute any output.
WARNING (VoskAPI:Check():nnet-nnet.cc:789) Node output.log-softmax is never used to compute any output.
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 7 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 7 orphan components.
LOG (VoskAPI:Collapse():nnet-utils.cc:1488) Added 0 components, removed 7
ASSERTION_FAILED (VoskAPI:AddMatVec():kaldi-vector.cc:98) Assertion failed: ((trans == kNoTrans && M.NumCols() == v.dim_ && M.NumRows() == dim_) || (trans == kTrans && M.NumRows() == v.dim_ && M.NumCols() == dim_))
Aborted (core dumped)

I used this command to extract:

root@f3ce6774e368:/workspace# /opt/kaldi/src/nnet3bin/nnet3-copy --nnet-config=exp/xvector_nnet_1a/extract.config exp/xvector_nnet_1a/final.raw exp/final.ext.raw
/opt/kaldi/src/nnet3bin/nnet3-copy --nnet-config=exp/xvector_nnet_1a/extract.config exp/xvector_nnet_1a/final.raw exp/final.ext.raw 
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node tdnn6.relu is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node tdnn6.batchnorm is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node tdnn7.affine is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node tdnn7.relu is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node tdnn7.batchnorm is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node output.affine is never used to compute any output.
WARNING (nnet3-copy[5.5]:Check():nnet-nnet.cc:789) Node output.log-softmax is never used to compute any output.
LOG (nnet3-copy[5.5]:main():nnet3-copy.cc:114) Copied raw neural net from exp/xvector_nnet_1a/final.raw to exp/final.ext.raw

in my extract.config: output-node name=output input=tdnn6.affine

nshmyrev commented 9 months ago

You can add the code to print the dimension and check what exactly mismatches

Natphitchayuk commented 9 months ago

thanks, I just copied configs from https://github.com/kaldi-asr/kaldi/blob/f88d5a361d0d19bf33fd344df79f634fa9eb71ff/egs/callhome_diarization/v1/local/nnet3/xvector/tuning/run_xvector_1a.sh and it solves