Updated model for ORT support#1359
Open
varun-jaiswal17 wants to merge 2 commits into
Open
Conversation
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR patches 18 ONNX test models under
testdata/dnn/onnx/models/to becompatible with the ONNX Runtime (ORT) engine (
OPENCV_FORCE_DNN_ENGINE=4).The models were regenerated or attribute-patched to remove deprecated/invalid
ONNX attributes that ORT enforces strictly.
Companion PR: opencv/opencv#28872
Binary model changes
average_pooling.onnxkernel_shape/stridesattribute encoding; re-exported at opset 7batch_norm.onnxspatial,is_test,consumed_inputsattributes (opset 1 → 7)constant.onnxdropout.onnxis_test,consumed_inputsattributes (opset 1 → 7)linear.onnxbroadcastattribute from Add node (opset 1 → 7)mul.onnxbroadcast,axisattributes from Mul node (opset 1 → 7)multy_inputs.onnxequal_same_dims.onnxreduce_mean_axis1.onnxaxesattribute withaxesinput (opset 11 → 11, attribute-style fixed)reduce_mean_axis2.onnxaxesattribute withaxesinput (opset 11 → 11, attribute-style fixed)reduce_sum.onnxdynamic_resize_10.onnxsizes/scalesinput to satisfy ORT shape requirementsdynamic_resize_9.onnxdynamic_resize_scale_10.onnxscalesinputdynamic_resize_scale_9.onnxscalesinputresize_bilinear.onnxroiandscalesinputs (opset 11)resize_nearest.onnxscalesinput (opset 9)resize_nearest_unfused_opset11_torch1.3.onnxTesting
All 18 affected tests pass with
OPENCV_FORCE_DNN_ENGINE=4,OPENCV_FORCE_DNN_ENGINE=2,OPENCV_FORCE_DNN_ENGINE=1:AveragePooling, BatchNormalization, Dropout, Linear, Multiplication,
CompareSameDims_EQ, ReduceMean, ReduceSum, Quantized_MatMul (via constant.onnx),
dynamic_resize_, resize_bilinear, resize_nearest, resize_nearest_unfused_