Skip to content

Instantly share code, notes, and snippets.

@yearofthewhopper
Created December 25, 2020 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yearofthewhopper/5f2072a15c336e2c83fbef3af0bcb4af to your computer and use it in GitHub Desktop.
Save yearofthewhopper/5f2072a15c336e2c83fbef3af0bcb4af to your computer and use it in GitHub Desktop.
model = Model()
model.eval()
random_input = torch.randn(1, 3, 512, 512, dtype=torch.float32)
input_names = ["image"]
output_names = ["outputImage"]
torch.onnx.export(model.netG, random_input, './model.onnx', verbose=False,
input_names=input_names, output_names=output_names,
opset_version=11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment