k2-fsa / icefall

https://k2-fsa.github.io/icefall/
Apache License 2.0
897 stars 286 forks source link

To get n-best (score) results from decoding with HLG #210

Open jty016 opened 2 years ago

jty016 commented 2 years ago

I am using one_best_decoding function to get the best path of lattice. Can I know what will be the most light way to get the n-best (score) path from the lattice in k2-based decoding scheme?

Because when I tried this with nbest_decoding function, it works. But it consumes much memory and reports OOM when the batch size is large.

What I'd like to try is utilizing k best list for other rescoring algorithm

csukuangfj commented 2 years ago

But it consumes much memory and reports OOM when the batch size is large.

How about decreasing batch size?

jty016 commented 2 years ago

I am utilizing k2 decoding scheme in real-time sense, so decreasing batch size means capacity shrinking ... so.

danpovey commented 2 years ago

You could try decreasing the num_paths, and/or decreasing the lattice depth by decreasing the beam or the max_active options.

jty016 commented 2 years ago

@danpovey Okay will try. Maybe I have to reduce also T size in N x T x C. Thank you