Bump supported ONNX RT version to 1.14.1#23529
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.
@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.
Existing tests pass with the ONNX models mentioned in tests.
Ok. Then all works.
There was a problem hiding this comment.
@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.
@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.
G-API ONNX doesn't support GPU. Or did I miss something?
There was a problem hiding this comment.
@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. |
asutic
left a comment
There was a problem hiding this comment.
A small classification test shows mismatch in results between ONNX RT and G-API.
asutic
left a comment
There was a problem hiding this comment.
Works properly after setting the input image shape to match the input shape of the model.
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.