docker-kaldi-gstreamer-serverkaldi-gstreamer-server:Master disconnected before decoder reached EOS?

worker.log

2021-04-12 03:23:03 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Postprocessing (final=False) result..
2021-04-12 03:23:03 -   DEBUG:       root: 84b53156-92b7-4c2a-93a6-5eed6f408281: Skipping postprocessing since post-processor already in use
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Postprocessing (final=False) result..
2021-04-12 03:23:03 -   DEBUG:       root: 84b53156-92b7-4c2a-93a6-5eed6f408281: Skipping postprocessing since post-processor already in use
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got partial result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got final result: ONE TWO THREE FALL FIVE SIX SEVEN EIGHT
2021-04-12 03:23:03 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Got full final result: {"total-length": 6.15, "segment-length": 6.15, "status": 0, "result": {"final": true, "hypotheses": [{"transcript": "ONE TWO THREE FALL FIVE SIX SEVEN EIGHT", "likelihood": 151.49}]}, "segment-start": 0.0}
2021-04-12 03:23:03 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Before postprocessing: {u'status': 0, u'segment-start': 0.0, u'segment-length': 6.15, u'total-length': 6.15, u'result': {u'hypotheses': [{u'likelihood': 151.49, u'transcript': u'ONE TWO THREE FALL FIVE SIX SEVEN EIGHT'}], u'final': True}, 'segment': 0, 'id': u'84b53156-92b7-4c2a-93a6-5eed6f408281'}
2021-04-12 03:23:04 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:05 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:06 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:07 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:08 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:09 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:10 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:11 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:12 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:13 -   DEBUG:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Checking that decoder hasn't been silent for more than 10 seconds
2021-04-12 03:23:14 - WARNING:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: More than 10 seconds from last decoder hypothesis update, cancelling
2021-04-12 03:23:14 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Master disconnected before decoder reached EOS?
2021-04-12 03:23:14 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Sending EOS to pipeline in order to cancel processing
2021-04-12 03:23:14 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Cancelled pipeline
2021-04-12 03:23:14 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:15 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:16 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:17 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:18 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:19 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:20 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:21 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:22 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:23 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:24 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:25 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:26 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:27 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:28 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:29 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:30 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:31 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:32 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:33 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:34 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:35 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:36 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:37 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:38 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:39 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:40 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:41 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:42 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:43 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Waiting for EOS from decoder
2021-04-12 03:23:44 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Giving up waiting after 31 tries
2021-04-12 03:23:44 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Resetting decoder state

问题点

curl -T ./english_test.ogg http://your.domain/client/dynamic/recognize
命令行测试,服务端没有响应。但是服务端worker.log中可查看到所识别的信息。
查看服务端worker.log,存在以下信息

2021-04-12 03:23:14 -    INFO:   __main__: 84b53156-92b7-4c2a-93a6-5eed6f408281: Master disconnected before decoder reached EOS?
2021-04-12 03:23:14 -    INFO:   decoder2: 84b53156-92b7-4c2a-93a6-5eed6f408281: Sending EOS to pipeline in order to cancel processing

解决

配置文件 ./start.sh -y [your file].yaml中,将post-processor 行注释掉

# You have to download TEDLIUM "online nnet2" models in order to use this sample
# Run download-tedlium-nnet2.sh in 'test/models' to download them.
use-nnet2: True
decoder:
    # All the properties nested here correspond to the kaldinnet2onlinedecoder GStreamer plugin properties.
    # Use gst-inspect-1.0 ./libgstkaldionline2.so kaldinnet2onlinedecoder to discover the available properties
    use-threaded-decoder:  true
    model : /opt/models/english/librispeech_nnet_a_online/final.mdl
    word-syms : /opt/models/english/librispeech_nnet_a_online/words.txt
    fst : /opt/models/english/librispeech_nnet_a_online/HCLG.fst
    mfcc-config : /opt/models/english/librispeech_nnet_a_online/conf/mfcc.conf
    ivector-extraction-config : /opt/models/english/librispeech_nnet_a_online/conf/ivector_extractor.conf
    max-active: 10000
    beam: 10.0
    lattice-beam: 6.0
    acoustic-scale: 0.083
    do-endpointing : true
    endpoint-silence-phones : "1:2:3:4:5:6:7:8:9:10"
    traceback-period-in-secs: 0.25
    chunk-length-in-secs: 0.25
    num-nbest: 1
    #Additional functionality that you can play with:
    #lm-fst:  test/models/english/librispeech_nnet_a_online/G.fst
    #big-lm-const-arpa: test/models/english/librispeech_nnet_a_online/G.carpa
    #phone-syms: test/models/english/librispeech_nnet_a_online/phones.txt
    #word-boundary-file: test/models/english/librispeech_nnet_a_online/word_boundary.int
    #do-phone-alignment: true
out-dir: tmp

use-vad: False
silence-timeout: 10

# Just a sample post-processor that appends "." to the hypothesis
# 将此行注释掉
# post-processor: perl -npe 'BEGIN {use IO::Handle; STDOUT->autoflush(1);} sleep(1); s/(.*)/\1./;'

#post-processor: (while read LINE; do echo $LINE; done)

# A sample full post processor that add a confidence score to 1-best hyp and deletes other n-best hyps
#full-post-processor: ./sample_full_post_processor.py

logging:
    version : 1
    disable_existing_loggers: False
    formatters:
        simpleFormater:
            format: '%(asctime)s - %(levelname)7s: %(name)10s: %(message)s'
            datefmt: '%Y-%m-%d %H:%M:%S'
    handlers:
        console:
            class: logging.StreamHandler
            formatter: simpleFormater
            level: DEBUG
    root:
        level: DEBUG
        handlers: [console]

修改yaml文件后测试

重启服务
curl -T ./english_test.ogg http://your.domain/client/dynamic/recognize
得到正确响应

# 得到正确响应
{"status": 0, "hypotheses": [{"utterance": "ONE TWO THREE FALL FIVE SIX SEVEN EIGHT"}], "id": "a9153956-1534-4696-a9b2-6ac903128e33"}
Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐