k2-fsa / k2

FSA/FST algorithms, differentiable, with PyTorch compatibility.
https://k2-fsa.github.io/k2
Apache License 2.0
1.11k stars 213 forks source link

RuntimeError in OnlineDenseIntersecter #1153

Open Temicia opened 1 year ago

Temicia commented 1 year ago

Hi, When using OnlineDenseIntersecter, an error occurs.

k2.OnlineDenseIntersecter(
      decoding_graph,
      num_streams=10,
      search_beam=20,
      output_beam=5,
      min_active_states=30,
      max_active_states=10000,
    )

decoding_graph = k2.ctc_topo(60)

Error :

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/anaconda3/envs/icefall/lib/python3.8/site-packages/k2/online_dense_intersecter.py", line 96, in __init__
    self.intersecter = _k2.OnlineDenseIntersecter(
RuntimeError: 
    Some bad things happened. Please read the above error messages and stack
    trace. If you are using Python, the following command may be helpful:

k2 version :

k2                      1.23.4.dev20230130

Can you help me? Thank you!

csukuangfj commented 1 year ago

Please post all the error logs.

The information you provided is too limited.

Temicia commented 1 year ago

The error has been resolved through the following:

self.decoding_graph = k2.Fsa.from_fsas([decoding_graph]).to(device)

Thanks!

csukuangfj commented 1 year ago

So are you using code from icefall or do you write the code by yourself? If it is from icefall, then it should be a bug.

Temicia commented 1 year ago

I personally use it, not from icefall.