Commit 0469bdc5 authored by Dan Povey's avatar Dan Povey
Browse files

Script fixes

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@619 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 2fb7df1e
......@@ -119,14 +119,16 @@ for ($try = 1; ; $try++) {
sleep(1); # now a full second.
if(`tail -1 $logfile` =~ m/Finished/) { exit(0); }
}
if ($try < $num_tries || ($ret == 0 && $try < $max_tries)) {
print STDERR "Command writing to $logfile failed with exit status $ret [on try $try]; waiting $delay seconds and trying again\n";
$is_bad_alloc = (system("grep bad_alloc $logfile >/dev/null") == 0 ?
", failed due to std::bad_alloc" : "");
if ($try < $num_tries || (($ret == 0 && !$is_bad_alloc) && $try < $max_tries)) {
print STDERR "Command writing to $logfile failed with exit status $ret$is_bad_alloc [on try $try]; waiting $delay seconds and trying again\n";
sleep($delay);
$delay += $increment;
system "mv $logfile $logfile.bak";
} else {
print STDERR "Command writing to $logfile failed after $try tries. Command is in $shfile\n";
print STDERR "Command writing to $logfile failed after $try tries, exit status=$ret$is_bad_alloc. Command is in $shfile\n";
exit(1);
}
}
......@@ -34,6 +34,20 @@ wavs=""
utt2spks=""
texts=""
nu=`cat $data/utt2spk | wc -l`
nf=`cat $data/feats.scp | wc -l`
nt=`cat $data/text | wc -l`
if [ $nu -ne $nf ]; then
echo "split_data.sh: warning, #lines is (utt2spk,feats.scp) is ($nu,$nf); this script "
echo " may produce incorrectly split data."
echo "use scripts/fix_data_dir.sh to fix this."
fi
if [ $nt -ne 0 -a $nu -ne $nt ]; then
echo "split_data.sh: warning, #lines is (utt2spk,text) is ($nu,$nt); this script "
echo " may produce incorrectly split data."
echo "use scripts/fix_data_dir.sh to fix this."
fi
# `scripts/get_split.pl` returns "0 1 2 3" or "00 01 .. 18 19" or whatever.
for n in `scripts/get_splits.pl $numsplit`; do
mkdir -p $data/split$numsplit/$n
......
......@@ -57,7 +57,7 @@ n1=`get_splits.pl $nj | awk '{print $1}'`
[ -f $alidir/$n1.trans ] && echo "Using speaker transforms from $alidir"
for n in `get_splits.pl $nj`; do
featspart[$n]="ark:apply-cmvn --norm-vars=false --utt2spk=ark:$data/split$nj/$n/utt2spk ark:$alidir/$n.cmvn scp:$data/split$nj/$n/feats.scp ark:- | splice-feats ark:- ark:- | transform-feats $alidir/final.mat ark:- ark:- |"
featspart[$n]="ark,s,cs:apply-cmvn --norm-vars=false --utt2spk=ark:$data/split$nj/$n/utt2spk ark:$alidir/$n.cmvn scp:$data/split$nj/$n/feats.scp ark:- | splice-feats ark:- ark:- | transform-feats $alidir/final.mat ark:- ark:- |"
if [ -f $alidir/$n1.trans ]; then
featspart[$n]="${featspart[$n]} transform-feats --utt2spk=ark:$data/split$nj/$n/utt2spk ark:$alidir/$n.trans ark:- ark:- |"
fi
......@@ -91,9 +91,9 @@ for x in 0 1 2 3; do
echo "Pass $x"
for n in `get_splits.pl $nj`; do
$cmd $dir/log/acc.$x.$n.log \
gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
gmm-gselect "--gselect=ark,s,cs:gunzip -c $dir/gselect_diag.$n.gz|" \
"fgmm-global-to-gmm $dir/$x.ubm - |" "${featspart[$n]}" ark:- \| \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "${featspart[$n]}" \
fgmm-global-acc-stats --gselect=ark,s,cs:- $dir/$x.ubm "${featspart[$n]}" \
$dir/$x.$n.acc || touch $dir/.error &
done
wait
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment