Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, onnx issue when running the inference part of examples/chinese_prosody_polyphone/run.sh #133

Open
dyustc opened this issue Apr 26, 2023 · 4 comments

Comments

@dyustc
Copy link

dyustc commented Apr 26, 2023

Hi, I went to the frontend folder, it seems the g2p_prosody.py is a ready-to-go inference script, only with this missing files. So where am I suppose to find these files in this repo? Correct me if you would, thanks.
usage: g2p_prosody.py [-h] --text TEXT --hanzi2pinyin_file HANZI2PINYIN_FILE --polyphone_phone_file POLYPHONE_PHONE_FILE --polyphone_prosody_model POLYPHONE_PROSODY_MODEL

@dyustc dyustc closed this as completed Apr 26, 2023
@dyustc dyustc changed the title Hi, is python g2p_prosody.py ready to run? Hi, onnx issue when running the inference part of examples/chinese_prosody_polyphone/run.sh Apr 26, 2023
@dyustc
Copy link
Author

dyustc commented Apr 26, 2023

hi, when I am running examples/chinese_prosody_polyphone/run.sh, the last part is inference part, I got the following error
[E:onnxruntime:, sequential_executor.cc:369 Execute] Non-zero status code returned while running Reshape node. Name:'/transform/self_attn/Reshape_4' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:40 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{7,1,768}, requested shape:{10,8,96}

also before that, when I convert .pt file to .onnx file, it also hints me to use onnx version 14 instead of version 13, otherwise the conversion would fail

@dyustc dyustc reopened this Apr 26, 2023
@mszpc
Copy link

mszpc commented Sep 18, 2023

I have also encountered the same problem. I'm not sure if you have found a solution to this problem

@wk448378469
Copy link

wk448378469 commented Sep 27, 2023

The pre trained model provided by the official uses the onnx file exported from Torch version 1.13.1. However, there is no limited version in requirements. txt, so the 2.0.1 torch will be downloaded.

Solution:

Option 1: requirements. txt torch==1.13.1
Option 2: Modify wetts/frontend/export_onnx. py dummy_input shape, such as 1 * 512, and then limit the input length to 1 * 512 when using your own ONNX model,and download torch nightly version。

If the specific reason is unclear, why is the dynamic in torch. onnx. export included in version 2.x The first axis of the input in axes has been set to "T", representing "dynamic", but it has not taken effect

@Jackiexiao
Copy link
Contributor

pytorch 2.0+ bug: see: pytorch/pytorch#99701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants