Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Models of opset 7,8 and 9 present slightly different results when optimized. #159

Open
researcher-no-name opened this issue Mar 7, 2025 · 0 comments

Comments

@researcher-no-name
Copy link

researcher-no-name commented Mar 7, 2025

While doing some research, I tried optimizing a number models with opset=7, 8, 9. These models have ONNX v3 format, but when optimized, although the structure remains the same, the format is upgraded implicitly to ONNX v4. This affects model correctness, to a small, but non-negligible extent, affecting top-5 and top-10 labels for classification models while the top-1 label remained accurate. This does not happen for models of higher opset (10 and above).

For instance, using ILSVRC2017 validation dataset (5.5k images) for classification models obtained from the ONNX Hub: (1) ResNet50-caffe2 presented ~13% difference in results across original and optimized model for top-10 labels and ~2% for top-5 labels, (2) ShuffleNet had 0.5-1% differences for the same cases. While it also slightly affected the F1 score for the bounding boxes of the object detection models (E.g., YOLO v2, had 0.2 % difference). There were also other models with even smaller differences.

I emphasize and report this, because such a small change is done implicitly, no indication is given, and is difficult to observe changes. However, the accuracy, even to a small extent, is essentially affected. I highly recommend that at least a warning is raised, if not patched altogether. The opsets I mentioned above are included in the official ONNX Hub for a large variety of models, and are expected to be backwards compartible with the current ONNX version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant