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

Export to ONNX Model possible? #17

Open
BoCiFOM opened this issue Jul 12, 2023 · 0 comments
Open

Export to ONNX Model possible? #17

BoCiFOM opened this issue Jul 12, 2023 · 0 comments

Comments

@BoCiFOM
Copy link

BoCiFOM commented Jul 12, 2023

Hello,
I would like to export my trained model to onnx model.

Export Function call:

dummy_input2 = torch.LongTensor(2, 2)
dummy_input2.requires_grad = False

torch.onnx.export(model.model,
(dummy_input0, dummy_input1, dummy_input2),
"Text-to-SQL.onnx",
input_names = ["input_ids", "input_mask", "segment_ids"],
output_names = ["output"]
)

“RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient”.

Do you some advices or a guide for exporting this model to onnx?

Best regards!

@BoCiFOM BoCiFOM closed this as completed Jul 12, 2023
@BoCiFOM BoCiFOM reopened this Jul 13, 2023
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

1 participant