tutorials
tutorials copied to clipboard
Export Pytorch to Onnx -> Dummy input?
I'm a little confused by what the dummy input should be in the documentation to export from Pytorch to Onnx?
Is this something I can determine from the Pytorch model's state_dict? https://gist.github.com/echan00/4154458473c4698c93d0597c617ff01a
In case you have not found the answer (and for future readers who will stumbled upon this thread)
ONNX export from Pytorch is done by tracing the graph; that is, it executes the graph once with the dummy input it's given While excuting the graph, it keeps track of PyTorch operations executed and then converts each of those operations to ONNX format You could use key-value parameter verbose=True to write the output to the terminal screen while exporting. it gives the intermediate representation of the graph in ONNX
Source: PyTorch Deep Learning Hands-On - Sherin Thomas, Sudhanshu Passi