export pytorch model in the onnx runtime format

Solutions on MaxInterview for export pytorch model in the onnx runtime format by the best coders in the world

showing results for - "export pytorch model in the onnx runtime format"
Lola
02 Jul 2019
1dummy_input = torch.randn(1, 3, 224, 224, device='cuda')
2onnx_path =  "./model.onnx"
3torch.onnx.export(learn.model, dummy_input, onnx_path, verbose=False)
4
5# The output will be the model written to a file called model.onnx.