Skip to content
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

Merged
merged 3 commits into from Oct 25, 2017
Merged

two small updates #1958

merged 3 commits into from Oct 25, 2017

Conversation

TianyanZhou
Copy link
Contributor

No description provided.

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}' \| \
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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".

Copy link
Contributor

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.

@@ -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:- |' \
Copy link
Contributor

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
@danpovey danpovey merged commit e8e86ae into kaldi-asr:master Oct 25, 2017
kronos-cm added a commit to kronos-cm/kaldi that referenced this pull request Oct 27, 2017
* '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)
  ...
mahsa7823 pushed a commit to mahsa7823/kaldi that referenced this pull request Feb 28, 2018
* Update score.sh

fix the "Scoring failed" problem in steps/decode.sh.

* Update cosine_scoring.sh

fixed awk syntax error

* Update cosine_scoring.sh
Skaiste pushed a commit to Skaiste/idlak that referenced this pull request Sep 26, 2018
* Update score.sh

fix the "Scoring failed" problem in steps/decode.sh.

* Update cosine_scoring.sh

fixed awk syntax error

* Update cosine_scoring.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants