Skip to content

Instantly share code, notes, and snippets.

@J3698
Created September 7, 2021 16:03
Show Gist options
  • Save J3698/04a01d11338cde5a0dd728886fcccfc1 to your computer and use it in GitHub Desktop.
Save J3698/04a01d11338cde5a0dd728886fcccfc1 to your computer and use it in GitHub Desktop.
Export simple test model
def export_test():
image = torch.ones((1, 3, 256, 256), requires_grad = False)
model = Test()
torch.onnx.export(model, image, "exports/test.onnx",
export_params = True,
opset_version = 11,
do_constant_folding = True,
input_names = ['input'],
output_names = ['output']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment