espnet/espnet_onnx

"indices element out of data bounds" while inferencing

jinggaizi opened this issue · 1 comments

hi ,
i try to inference wav as the document
"import librosa
from espnet_onnx import Speech2Text
speech2text = Speech2Text(tag_name='')
y, sr = librosa.load('sample.wav', sr=16000)
nbest = speech2text(y)"
but when run "nbest = speech2text(y)" , occur a error like
"onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running Gather node. Name:'Gather_4' Status Message: indices element out of data bounds, idx=525 must be within the inclusive range [-512,511]"
my feats_lengths is 526, why this error occurs

Hi @jinggaizi , you can set max_seq_len operation as the following:

from espnet_onnx.export import ASRModelExport

m = ASRModelExport()
m.set_export_config(
    max_seq_len=1024
)
m.export_from_pretrained(...)