yolov7_d2
yolov7_d2 copied to clipboard
Should I expect same output for the same sparseinst model before and after onnx export?
Hi,
After exporting sparseinst to onnx I receive similar but slightly different output if I give the two models (.pth and .onnx) the same image input. Is this expected? Does it have to do with the different warnings during export such as:
TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
See attached images for onnx (green) vs. pth model output for the same image and how they differ between the front legs and around the tail.
.
it was acceptable, there might be some slightly difference between floats, but it's OK in inference.