We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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!
The text was updated successfully, but these errors were encountered: