PaddlePaddle / PaddleSpeech

Easy-to-use Speech Toolkit including Self-Supervised Learning model, SOTA/Streaming ASR with punctuation, Streaming TTS with text frontend, Speaker Verification System, End-to-End Speech Translation and Keyword Spotting. Won NAACL2022 Best Demo Award.
https://paddlespeech.readthedocs.io
Apache License 2.0
10.99k stars 1.83k forks source link

onnxruntime推理失败-stage6 #3337

Open zapjone opened 1 year ago

zapjone commented 1 year ago

执行examples/csmsc下的run.sh --stage 6 --stop-stage 6来进行onnxruntime推理时(stage0~stage5都是已成功执行完成),报以下错误,请问有谁遇到过吗? [2023-06-14 08:23:03,244] [ INFO] - Already cached /home/icksys/.paddlenlp/models/bert-base-chinese/bert-base-chinese-vocab.txt [2023-06-14 08:23:03,254] [ INFO] - tokenizer config file saved in /home/icksys/.paddlenlp/models/bert-base-chinese/tokenizer_config.json [2023-06-14 08:23:03,254] [ INFO] - Special tokens file saved in /home/icksys/.paddlenlp/models/bert-base-chinese/special_tokens_map.json Building prefix dict from the default dictionary ... [2023-06-14 08:23:03,932] [ DEBUG] init.py:113 - Building prefix dict from the default dictionary ... Loading model from cache /tmp/jieba.cache [2023-06-14 08:23:03,933] [ DEBUG] init.py:132 - Loading model from cache /tmp/jieba.cache Loading model cost 0.624 seconds. [2023-06-14 08:23:04,556] [ DEBUG] init.py:164 - Loading model cost 0.624 seconds. Prefix dict has been built successfully. [2023-06-14 08:23:04,556] [ DEBUG] init.py:166 - Prefix dict has been built successfully. 2023-06-14 08:23:04.586965864 [E:onnxruntime:, sequential_executor.cc:514 ExecuteKernel] Non-zero status code returned while running Gather node. Name:'p2o.Gather.0' Status Message: indices element out of data bounds, idx=216 must be within the inclusive range [-208,207] Traceback (most recent call last): File "/home/icksys/tts/PaddleSpeech/paddlespeech/t2s/exps/fastspeech2/../ort_predict_e2e.py", line 235, in main() File "/home/icksys/tts/PaddleSpeech/paddlespeech/t2s/exps/fastspeech2/../ort_predict_e2e.py", line 231, in main ort_predict(args) File "/home/icksys/tts/PaddleSpeech/paddlespeech/t2s/exps/fastspeech2/../ort_predict_e2e.py", line 86, in ort_predict am_sess.run(None, input_feed=am_input_feed) File "/home/icksys/anaconda3/envs/paddle/lib/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 217, in run return self._sess.run(output_names, input_feed, run_options) onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running Gather node. Name:'p2o.Gather.0' Status Message: indices element out of data bounds, idx=216 must be within the inclusive range [-208,207]

zxcd commented 1 year ago

目测是因为你训练的时候的配置和使用onnx推理的时候配置不一致导致的。 indices element out of data bounds, idx=216 must be within the inclusive range [-208,207] 建议检查一下

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

wmlgl commented 11 months ago

Reference

从stage 0一直执行到后面配置没有修改过哟,不过我出现问题的是训练英文模型的时候,非onnx是正常的,转成onnx就报错了