Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created October 17, 2020 17:40
Show Gist options
  • Save pranjalAI/ea7cbe9b0b35c08c43f4d0b66e4a65f0 to your computer and use it in GitHub Desktop.
Save pranjalAI/ea7cbe9b0b35c08c43f4d0b66e4a65f0 to your computer and use it in GitHub Desktop.
model.eval()
dummy_input = torch.randn(1, 3, INPUT_HEIGHT, INPUT_WIDTH,
dtype=torch.float32, device=DEVICE)
output = model(dummy_input.detach())
input_names = ['data']
output_names = ['output1']
torch.onnx.export(model, dummy_input,
ONNX_PATH, verbose=False,
input_names=input_names, output_names=output_names)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment