Skip to content

Commit 99a4463

Browse files
ferb2015naxingyu
authored andcommitted
[src] Make compute-gop work with missing alignments (#3830)
1 parent 6eb4e80 commit 99a4463

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/compute-gop.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ int main(int argc, char *argv[]) {
155155
int32 num_done = 0;
156156
for (; !prob_reader.Done(); prob_reader.Next()) {
157157
std::string key = prob_reader.Key();
158+
if (!alignment_reader.HasKey(key)) {
159+
KALDI_WARN << "No alignment for utterance " << key;
160+
continue;
161+
}
158162
auto alignment = alignment_reader.Value(key);
159163
Matrix<BaseFloat> &probs = prob_reader.Value();
160164
if (log_applied) probs.ApplyExp();

0 commit comments

Comments
 (0)