From c8bf123702379f92f62f73801791a5f50e33de21 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 3 May 2016 14:49:55 -0400 Subject: [PATCH 1/2] Modify steps/nnet{2,3}/decode.sh to only pass in the --iter option to scoring if needed. --- egs/wsj/s5/steps/nnet2/decode.sh | 9 +++++---- egs/wsj/s5/steps/nnet3/decode.sh | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/egs/wsj/s5/steps/nnet2/decode.sh b/egs/wsj/s5/steps/nnet2/decode.sh index e4e726522..7f1c8c267 100755 --- a/egs/wsj/s5/steps/nnet2/decode.sh +++ b/egs/wsj/s5/steps/nnet2/decode.sh @@ -68,7 +68,7 @@ done sdata=$data/split$nj; cmvn_opts=`cat $srcdir/cmvn_opts` || exit 1; thread_string= -[ $num_threads -gt 1 ] && thread_string="-parallel --num-threads=$num_threads" +[ $num_threads -gt 1 ] && thread_string="-parallel --num-threads=$num_threads" mkdir -p $dir/log [[ -d $sdata && $data/feats.scp -ot $sdata ]] || split_data.sh $data $nj || exit 1; @@ -99,7 +99,7 @@ if [ ! -z "$transform_dir" ]; then [ ! -s $transform_dir/num_jobs ] && \ echo "$0: expected $transform_dir/num_jobs to contain the number of jobs." && exit 1; nj_orig=$(cat $transform_dir/num_jobs) - + if [ $feat_type == "raw" ]; then trans=raw_trans; else trans=trans; fi if [ $feat_type == "lda" ] && \ @@ -142,7 +142,7 @@ if [ $stage -le 1 ]; then $graphdir/HCLG.fst "$feats" "ark:|gzip -c > $dir/lat.JOB.gz" || exit 1; fi -# The output of this script is the files "lat.*.gz"-- we'll rescore this at +# The output of this script is the files "lat.*.gz"-- we'll rescore this at # different acoustic scales to get the final output. @@ -151,7 +151,8 @@ if [ $stage -le 2 ]; then [ ! -x local/score.sh ] && \ echo "Not scoring because local/score.sh does not exist or not executable." && exit 1; echo "score best paths" - local/score.sh --iter $iter $scoring_opts --cmd "$cmd" $data $graphdir $dir + [ "$iter" != "final" ] && iter_opt="--iter $iter" + local/score.sh $iter_opt $scoring_opts --cmd "$cmd" $data $graphdir $dir echo "score confidence and timing with sclite" fi fi diff --git a/egs/wsj/s5/steps/nnet3/decode.sh b/egs/wsj/s5/steps/nnet3/decode.sh index 1a60118c6..151dd6be2 100755 --- a/egs/wsj/s5/steps/nnet3/decode.sh +++ b/egs/wsj/s5/steps/nnet3/decode.sh @@ -170,7 +170,8 @@ if [ $stage -le 2 ]; then [ ! -x local/score.sh ] && \ echo "Not scoring because local/score.sh does not exist or not executable." && exit 1; echo "score best paths" - local/score.sh --iter $iter $scoring_opts --cmd "$cmd" $data $graphdir $dir + [ "$iter" != "final" ] && iter_opt="--iter $iter" + local/score.sh $iter_opt $scoring_opts --cmd "$cmd" $data $graphdir $dir echo "score confidence and timing with sclite" fi fi From b5d0718ad3d0bab97938d72c8d71bc1d084275f0 Mon Sep 17 00:00:00 2001 From: Jan Trmal Date: Tue, 3 May 2016 15:38:24 -0400 Subject: [PATCH 2/2] fixing path.sh --- egs/iban/s5/path.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/egs/iban/s5/path.sh b/egs/iban/s5/path.sh index 8f2d8c3b3..2d17b17a8 100755 --- a/egs/iban/s5/path.sh +++ b/egs/iban/s5/path.sh @@ -1,10 +1,6 @@ -#!/bin/bash - export KALDI_ROOT=`pwd`/../../.. -. $KALDI_ROOT/tools/config/common_path.sh - +[ -f $KALDI_ROOT/tools/env.sh ] && . $KALDI_ROOT/tools/env.sh export PATH=$PWD/utils/:$KALDI_ROOT/tools/openfst/bin:$PWD:$PATH - -. $KALDI_ROOT/tools/env.sh +[ ! -f $KALDI_ROOT/tools/config/common_path.sh ] && echo >&2 "The standard file $KALDI_ROOT/tools/config/common_path.sh is not present -> Exit!" && exit 1 +. $KALDI_ROOT/tools/config/common_path.sh export LC_ALL=C -