We are automating a process to create hundreds of onnx models in a row and these messages can make the log cluttered and hard to read. I understand that an older version of PyTorch (torch 1.13.1) did not have this behavior, so I’m wondering if there is a way to remove it in version 2.0.1
We decided to leave the diagnostic messages as is given the side effects of the two solutions below:
We could run the script like this: python3 onnx_export.py >> /dev/null 2>&1 . All stdout output will be dumped into /dev/null which discards it, leaving only stderr showing. This has the side effect of getting rid of all print statements in the script, which we don’t want.
We could also use an earlier version of PyTorch such as 1.13.1, but the side effect being the potential negative effects of not using the latest version of PyTorch.
The accepted answer does not solve the problem. Users would like to avoid this output clutter.
If there are no errors to report, then by default there should be no console message. Users who wish the “Diagnostic” summary even when there are no errors should enable it explicitly.