-
Notifications
You must be signed in to change notification settings - Fork 10
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
onnx exports #1
Comments
Which model format you need?
|
im looking to try CPU |
Download the models and set the path. Next, run the following python script to get the inference results.
|
Try again~ |
The Inference script was edited. Make sure to copy the latest one. : ) |
getting an error with the script:
|
errr nevermind, the audio file is not formatted correctly ... sorry |
i added this to handle >1 channel in wav audio, sr = torchaudio.load(reference_audio)
if sr != SAMPLE_RATE:
resampler = torchaudio.transforms.Resample(orig_freq=sr, new_freq=SAMPLE_RATE) # noqa
audio = resampler(audio)
if audio.shape[0] > 1:
audio = torch.mean(audio, dim=0, keepdim=True) |
im just getting noise in |
do we need to use vocos to generate the final wav? |
All process including STFT, Vocos and ISTFT were converted in ONNX operators. Directly run the three models should work. We use the ONNXRuntime==1.19.2 for running and work well. The valid shape for audio is (1, 1, audio_len). Hence, make sure the dim setting in torch.mean() to keep the valid shape as input. |
thanks, ill check ONNXRuntime version |
Could you post the GPU one as well? @DakeQQ |
@rachelbeeson |
No problem, thank you for the hint. I did try as you say (export and then change precision) but I found running the exported model on ONNX was slower than running the original on torch for GPU, so I guess I wanted to see if the owner's export would give me a similar result or if maybe I messed up somewhere :) |
I am also keen to try the ONNX for gpu! |
@rachelbeeson |
When i run this with the provided script on my 4090 it takes about 48 seconds to create a 7 second output - and the output is of a much lower quality than the original weights. Is this the expected behavior? |
Unfortunately, that's not the case. If you're using an RTX-4090, please try the following script. In the console window, press Ctrl+F and search for the keyword 'number' to check how many nodes are placed on the TensorRT or CUDA provider. If most nodes are placed on the GPU but you're still experiencing poor performance, it may be an issue with the ONNX Runtime.
|
Thanks for your reply! There is no 'number in my console output running the above script. Microsoft Windows [Version 10.0.26100.2314] I:\F5_4\F5-TTS\venv\Scripts>activate (venv) I:\F5_4\F5-TTS\venv\Scripts>cd I:\F5_4\F5-TTS\src\f5_tts\infer (venv) I:\F5_4\F5-TTS\src\f5_tts\infer>python infer_gradio_onnx2.py (venv) I:\F5_4\F5-TTS\src\f5_tts\infer>python infer_gradio_onnx2.py Run F5-TTS by ONNX Runtime. Audio generation is complete. ONNXRuntime Time Cost in Seconds: |
The key message is as follows:
It shows all |
thanks again. I have now the correct onnxruntime-gpu 1.20.0 and deleted my pervious install then validated that i in fact had the correct install. It gives me a log flood that i exit after a minute or two. I have double checked the correct onnxruntime and ensured I have the script as you pasted it. I only changed the paths. And advice would be great. Thank you |
Set the log level to 3 to hide most messages. Regarding issues with running models using ONNXRuntime and NVIDIA GPU providers, professional assistance can be provided by @Bigfishering. Hello @Bigfishering, 我们想知道怎么用ONNX Runtime GPU + |
Would it be possible to share the onnx exports?
The text was updated successfully, but these errors were encountered: