New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
two small updates #1958
two small updates #1958
Conversation
fix the "Scoring failed" problem in steps/decode.sh.
fixed awk syntax error
@@ -22,7 +22,7 @@ scores_dir=$6 | |||
|
|||
mkdir -p $scores_dir/log | |||
run.pl $scores_dir/log/cosine_scoring.log \ | |||
cat $trials \| awk '{print $1, $2}' \| \ | |||
cat $trials \| awk '{print $1" "$2}' \| \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about what version of awk you are using. I'm not aware of any version for which this would be a syntax error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TianyanZhou, please notice my comment above RE your version of awk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using GNU Awk 4.0.1. I forget to mention that there is another problem in this script. Line 28: 'ark:ivector-normalize-length scp:${test_ivec_dir}/ivector.scp ark:- |'. Shell cannot refer to variable ${test_ivec_dir} and report an error "Failed to open script file /ivector.scp". When I surround line 28 with a double quotation mark, it can refer to ${test_ivec_dir} successfully but reports "awk syntax error '{print $1, $2}'". And after I change '{print $1, $2}' to '{print $1" "$2}', this script works finally. I agree that "awk '{print $1, $2}" should not be a syntax error. It's kind of weird shell reports this. I also noticed the original command (cat data/sre10_test/trials | awk '{print $1, $2}' | ) became (cat data/sre10_test/trials | awk "{print $1, $2}" | ) in file "exp/scores_cosine/log/cosine_scoring.log", why it replaces the awk 'print' command with a double quotation mark. I'm not sure whether this is because my awk version or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an issue with run.pl. You can fix it in this PR if you want, but revert this change (and test the fix).
You have to replace the lines in run.pl:
foreach $x (@ARGV) {
if ($x =~ m/^\S+$/) { $cmd .= $x . " "; }
elsif ($x =~ m:\":) { $cmd .= "'$x' "; }
else { $cmd .= "\"$x\" "; }
}
with the lines beginning foreach my $x (@ARGV) {
in queue.pl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this, it still failed with the same "awk syntax error".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see why now-- I'll merge your changes as-is.
egs/sre10/v1/local/cosine_scoring.sh
Outdated
@@ -22,7 +22,7 @@ scores_dir=$6 | |||
|
|||
mkdir -p $scores_dir/log | |||
run.pl $scores_dir/log/cosine_scoring.log \ | |||
cat $trials \| awk '{print $1, $2}' \| \ | |||
cat $trials \| awk '{print $1" "$2}' \| \ | |||
ivector-compute-dot-products - \ | |||
scp:${enroll_ivec_dir}/spk_ivector.scp \ | |||
'ark:ivector-normalize-length scp:${test_ivec_dir}/ivector.scp ark:- |' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, the single quotes should be double quotes-- otherwise the shell will not expand the variable.
Line 28 should use double quotes to expand variables
* 'master' of https://github.com/kaldi-asr/kaldi: (45 commits) [scripts] Fix a bug in attention xconfig regarding key-scale (thanks: Pegah) (kaldi-asr#1975) [src,scripts] nnet1: various minor changes, (kaldi-asr#1962) [build] Make nvcc respect CXX (kaldi-asr#1965) [egs] Further small HKUST and SRE fixes (kaldi-asr#1971) [egs] Small egs fixes to HKUST and sre10 (kaldi-asr#1958) [egs,scripts] Add support for l2-regularize to LSTM layers; give example. [scripts] Small fix to nnet3 training scripts: pass egs_command to get_egs.sh (kaldi-asr#1970) [egs] Updates to Chime4 recipe (kaldi-asr#1956) [src,scripts,egs] Make it possible to specify component-level l2 regularization (kaldi-asr#1959) [egs] fix to scoring script error in HKUST recipe (kaldi-asr#1957) [egs,scripts] Disambiguate cmd.sh and path.sh pathnames: add './' (kaldi-asr#1953) [scripts] Simplify and remove non-useful diagnostics in nnet3 training scripts [egs] Fixed a missing xconfig change of the tdnn recipe in the previous commit (kaldi-asr#1948) [scripts] Add new tuning option for speech activity detection (SAD) scripts (kaldi-asr#1949) [egs] Adding new non-splicing layers in the AMI TDNN setup (kaldi-asr#1947) [egs] Librispeech: make sure phone list is sorted, for repeatability (kaldi-asr#1946) [doc] Fix path in kaldi for dummies (thanks: Ermand Hoxha) [scripts,egs] Use KALDI_ROOT instead of relative path (kaldi-asr#1941) [src,egs] Minor tweaks in nnet3 code (diagnostics,testing); add stage option to swbd setup. [egs] Adding new non-splicing layers in some TDNN setups. (kaldi-asr#1937) ...
* Update score.sh fix the "Scoring failed" problem in steps/decode.sh. * Update cosine_scoring.sh fixed awk syntax error * Update cosine_scoring.sh
* Update score.sh fix the "Scoring failed" problem in steps/decode.sh. * Update cosine_scoring.sh fixed awk syntax error * Update cosine_scoring.sh
No description provided.