-
-
Notifications
You must be signed in to change notification settings - Fork 56.3k
Bump supported ONNX RT version to 1.14.1 #23529
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
Conversation
- Existing tests pass with the ONNX models mentioned in tests.
Ort::AllocatedStringPtr name_p = pos == INPUT | ||
? this_session.GetInputNameAllocated(i, allocator) | ||
: this_session.GetOutputNameAllocated(i, allocator); | ||
tensor_info.back().name = std::string(name_p.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmatveev, please, check that copy is created properly, because AllocatedStringPtr name_p will die in this scope.
Try run demos or onnx tests. I did not see onnx check (mb I am blind).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing tests pass with the ONNX models mentioned in tests.
Ok. Then all works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmatveev Did the G-API ONNX classification test pass on your end (requires model downloading, see https://github.com/opencv/opencv/blob/4.x/modules/gapi/misc/python/test/test_gapi_infer_onnx.py#L21)? The model I have keeps returning garbage and inference results don't differ at all while I process my video sample. The behavior is the same on the CPU and GPU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpashchenkov thanks for review, std::string copies its char*
argument (not moves) so its ok for name_p
to be destroyed right after.
@asutic I will have a look on that, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G-API ONNX doesn't support GPU. Or did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmatveev,
A crutch for the longevity of names:
Keep ptrs in class state ->
std::vector<const char*> inputNodeNames;
std::vector<Ort::AllocatedStringPtr> inputNodePtrs;
just in case *
@dmatveev, https://github.com/opencv/opencv_extra/blob/4.x/testdata/gapi/onnx/download_onnx_models.py Script can be updated for current modes or (if works) link can be posted on the WIKI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small classification test shows mismatch in results between ONNX RT and G-API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works properly after setting the input image shape to match the input shape of the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :+1
Thanks @mpashchenkov I missed this! I crafted wiki with manual commands to download models instead :) https://github.com/opencv/opencv/wiki/Using-G-API-with-MS-ONNX-Runtime |
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.