-
Notifications
You must be signed in to change notification settings - Fork 39
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
Is There a Sample Showing How to Convert to ONNX? #41
Comments
I was able to export a DeepPhonemizer model to onnx but the shapes on the exported model aren't dynamic (and I therefore can't just feed it text of arbitrary length). I used the following to create the onnx mode: Define a dictionary input that matches the model's expected input format
I experimented with also including 'text_len' and 'start_index' in the input_names array but I couldn't get the model to export to onnx with those keys included. Clearly I'm not properly telling the converter I want a dynamic shape. Any help would be appreciated. It would be awesome to be able to deploy this with the onnx runtime. |
I had better luck with the other newer ONNX exporter provided by PyTorch. |
Hi @SeymourNickelson , |
@NextDevX Kafan1986 here, replying to you from another account. As mentioned earlier, this version won't give you token probabilities separately and you need to manually remove consecutive duplicates from the final output. Should be quite easy.
|
Thank you for your answer.
|
@NextDevX Did you manage to make it run after all? |
Yes, I can use onnxruntime and run it. |
I managed as well today. The forward model, right? I assume without the
internal dictionary or is this also somehow exportable. Did you use it to
train another network?
…On Wed, 24 Jul 2024, 21:09 NextDevX, ***@***.***> wrote:
@NextDevX <https://github.com/NextDevX> Did you manage to make it run
after all?
Yes, I can use onnxruntime and run it.
—
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AECUDGATWEP56LXDIITGBODZN73WHAVCNFSM6AAAAAA7D2R5PSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG4ZDCNRQHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This looks like a really cool project. Thanks for your hard work.
Could someone please provide a sample of how to convert to ONNX? I'm new to this and I'm having a hard time figuring out how to provide the sample input. I see some others were having the same problem in this closed issue (#23). While some said they were able to export to ONNX, nobody provided a code sample of the export formula.
I see the forward method in ForwardTransformer class takes a dictionary with tensors for the following keys: text, start_index, and text_len.'
Since the model takes text on input at variable length (not fixed size) and returns output I assume I have to tell orch.onnx.export that the input for the "text" entry is a dynamic shape and that the output is a dynamic shape. I tried setting dynamic_axes but didn't have any success. If anyone could provide a sample it would be much appreciated.
The text was updated successfully, but these errors were encountered: