uhh-lt / kaldi-tuda-de

Scripts for training general-purpose large vocabulary German acoustic models for ASR with Kaldi.
Apache License 2.0
172 stars 36 forks source link

Worker fails on start #20

Closed habernal closed 5 years ago

habernal commented 5 years ago

I've tried to run the provided pre-trained model de_350k_nnet3chain_tdnn1f_1024_sp_bi.tar.bz2 on a working installation of Kaldi (i.e., the tedlium worker works with Gstreamer plugin successfully). I've copied the files and changed the paths in yaml accordingly but when starting the worker, the following error occurs. Obviously, self.asr is None. Any hints?

a@a:~/kaldi/tools/kaldi-gstreamer-server$ ./run_tuda_de.sh 
   DEBUG 2018-12-21 14:14:47,472 Starting up worker 
2018-12-21 14:14:47 -    INFO:   decoder2: Creating decoder using conf: {'post-processor': "perl -npe 'BEGIN {use IO::Handle; STDOUT->autoflush(1);} s/(.*)/\\1./;'", 'logging': {'version': 1, 'root': {'level': 'DEBUG', 'handlers': ['console']}, 'formatters': {'simpleFormater': {'datefmt': '%Y-%m-%d %H:%M:%S', 'format': '%(asctime)s - %(levelname)7s: %(name)10s: %(message)s'}}, 'disable_existing_loggers': False, 'handlers': {'console': {'formatter': 'simpleFormater', 'class': 'logging.StreamHandler', 'level': 'DEBUG'}}}, 'use-vad': False, 'decoder': {'ivector-extraction-config': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/ivector_extractor/ivector_extractor.conf', 'lattice-beam': 5.0, 'acoustic-scale': 1.0, 'do-endpointing': True, 'beam': 5.0, 'mfcc-config': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/conf/mfcc_hires.conf', 'traceback-period-in-secs': 0.25, 'nnet-mode': 3, 'endpoint-silence-phones': '1:2:3:4:5:6', 'word-syms': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/words.txt', 'num-nbest': 10, 'frame-subsampling-factor': 3, 'phone-syms': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/phones.txt', 'max-active': 10000, 'fst': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/HCLG.fst', 'use-threaded-decoder': True, 'model': 'test/models/german/de_350k_nnet3chain_tdnn1f_1024_sp_bi/final.mdl', 'chunk-length-in-secs': 0.25}, 'silence-timeout': 15, 'out-dir': 'tmp', 'use-nnet2': True}
Traceback (most recent call last):
  File "kaldigstserver/worker.py", line 419, in <module>
    main()
  File "kaldigstserver/worker.py", line 409, in main
    decoder_pipeline = DecoderPipeline2(conf)
  File "/home/xxx/kaldi/tools/kaldi-gstreamer-server/kaldigstserver/decoder2.py", line 25, in __init__
    self.create_pipeline(conf)
  File "/home/xxx/kaldi/tools/kaldi-gstreamer-server/kaldigstserver/decoder2.py", line 55, in create_pipeline
    self.asr.set_property("use-threaded-decoder", conf["decoder"]["use-threaded-decoder"])
AttributeError: 'NoneType' object has no attribute 'set_property'
habernal commented 5 years ago

This was a trivial issue. The problem is that the script run_tuda_de.sh overrides the global variable KALDI_ROOT on the first line:

export KALDI_ROOT=/home/me/kaldi
export GST_PLUGIN_PATH=$KALDI_ROOT/tools/gst-kaldi-nnet2-online/src
python kaldigstserver/worker.py -u ws://localhost:8100/worker/ws/speech -c kaldi_tuda_de_nnet3_chain.yaml

while the original English model simply re-uses the global variable:

export KALDI_ROOT=$KALDI_ROOT
export GST_PLUGIN_PATH=$KALDI_ROOT/tools/gst-kaldi-nnet2-online/src 
python kaldigstserver/worker.py -u ws://localhost:8100/worker/ws/speech -c sample_english_nnet2.yaml

After setting the variable properly, the decoder started.

svenha commented 5 years ago

Thanks for sharing the fix. I will try kaldi-gstreamer-server as described in the News item from 2018-08-21.

bmilde commented 5 years ago

Thanks for reporting this, I added a sentence in the README to point out that you need to change the KALDI_ROOT variable.