Merge pull request #3272 from godefv/master

In ctc_beam_search_decoder(), added a sanity check between input class_dim and alphabet
This commit is contained in:
lissyx 2020-08-25 14:04:41 +02:00 committed by GitHub
commit 903fec464a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,6 +226,7 @@ std::vector<Output> ctc_beam_search_decoder(
std::shared_ptr<Scorer> ext_scorer,
size_t num_results)
{
VALID_CHECK_EQ(alphabet.GetSize()+1, class_dim, "Number of output classes in acoustic model does not match number of labels in the alphabet file. Alphabet file must be the same one that was used to train the acoustic model.");
DecoderState state;
state.init(alphabet, beam_size, cutoff_prob, cutoff_top_n, ext_scorer);
state.next(probs, time_dim, class_dim);