espnet/espnet_onnx

(bug)[ONNXRuntimeError] : 2 : INVALID_ARGUMENT

weirdseed opened this issue · 2 comments

Error:

[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running ScatterND node. Name:'ScatterND_70' Status Message: invalid indice found, indice = -1
File "D:\recognition\espnet\esp2onnx\espnet_onnx\asr\model\decoders\xformer.py", line 84, in batch_score
input_dict
File "D:\recognition\espnet\esp2onnx\espnet_onnx\asr\beam_search\batch_beam_search.py", line 136, in score_full
scores[k], states[k] = d.batch_score(hyp.yseq, hyp.states[k], x)
File "D:\recognition\espnet\esp2onnx\espnet_onnx\asr\beam_search\batch_beam_search.py", line 195, in search
[x for _ in range(n_batch)]).reshape(n_batch, *x.shape))
File "D:\recognition\espnet\esp2onnx\espnet_onnx\asr\beam_search\beam_search.py", line 334, in call
best = self.search(running_hyps, x)
File "D:\recognition\espnet\esp2onnx\espnet_onnx\asr\asr_model.py", line 84, in call
nbest_hyps = self.beam_search(enc[0])[:1]
File "D:\recognition\espnet\esp2onnx\demo.py", line 12, in
res = speech2text(speech=data)

Code:

from espnet_onnx import Speech2Text
import librosa
import numpy as np

if __name__ == "__main__":
    tag = 'espnet/Shinji_Watanabe_laborotv_asr_train_asr_conformer2_latest33_raw_char_sp_valid.acc.ave'

    speech2text = Speech2Text(tag)

    data, _ = librosa.load('1.wav',sr=16000)

    res = speech2text(speech=data)
    print(res)

Enviroment:
win11,python3.7.7,onnx==1.12.0,onnxruntime==1.10.0,espnet==202205

If you want to export pretrained model, you need to install torch>=1.11.0, espnet, espnet_model_zoo, onnx additionally. onnx==1.12.0 might cause some errors. If you got an error while inference or exporting, please consider downgrading the onnx version.
@weirdseed try onnx==1.11..0

Thanks a lot!
I solved the problem after reinstalling all my packages.