TFLite models on different backends (tests and improvements)#24039
TFLite models on different backends (tests and improvements)#24039asmorkalov merged 12 commits intoopencv:4.xfrom
Conversation
|
@asmorkalov, do we still have an option to run CI with OpenVINO setup somehow? |
Legacy CI:
|
|
I see the following failure with the patch: Not sure if it's relevant. Will check 4.x and return back with details. |
|
The issue is not relevant to the PR and exists in 4.x too. OpenVINO version: openvino_toolkit_ubuntu18_2022.1.1.7030.39aba80957e |
351cf92 to
5e4f0af
Compare
Number of |
|
@dkurt could you rebase the patch and fix conflicts. |
|
@asmorkalov, I also waiting for https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100310 but it runs too long on the latest commit (previous were fine). So need to check that problem is not in the changes from the latest commit. |
b6152bb to
1899ef0
Compare
| std::vector<std::vector<Mat> > outs; | ||
| net.forward(outs, {"p_re_lu_1", "max_pooling_with_argmax2d", "conv2d_86", "max_unpooling2d_2"}); | ||
| if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH) { | ||
| // TODO: seems like a bug with a retrieving intermediate tensors |
There was a problem hiding this comment.
Please file a ticket about it.
|
@dkurt Thanks a for the branch rebase. Looks like there is some interference with previous patches. I see a lot of new regressions with OpenVINO. Full list of failed test: Detailed logs: |
|
@asmorkalov, thanks! I will fix it. |
1899ef0 to
89dee28
Compare
| #endif | ||
| // https://github.com/openvinotoolkit/openvino/issues/18731 | ||
| if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && stride != Size(1, 1)) | ||
| applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); |
There was a problem hiding this comment.
@asmorkalov, please do not merge, I'm going to workaround it as suggested in the ticket.
There was a problem hiding this comment.
Please ignore, this must complicate this PR too much. Let's just skip for now
@asmorkalov, seems like Custom worker got stuck. The job is always "queued". |
|
The last version passes all tests with l_openvino_toolkit_ubuntu18_2022.1.1! |
| std::shared_ptr<ngraph::Node> max_pool; | ||
| if (computeMaxIdx) { | ||
| std::vector<size_t> dilations(kernel_size.size(), 1); | ||
| max_pool = std::make_shared<ngraph::op::v8::MaxPool>(ieInpNode, ngraph::Strides(strides), ngraph::Strides(dilations), |
There was a problem hiding this comment.
There are broken weekly builds:
/build/4_x_openvino-opencl-skl-lin64/opencv/modules/dnn/src/layers/pooling_layer.cpp: In member function 'virtual cv::Ptr<cv::dnn::dnn4_v20230620::BackendNode> cv::dnn::PoolingLayerImpl::initNgraph(const std::vector<cv::Ptr<cv::dnn::dnn4_v20230620::BackendWrapper> >&, const std::vector<cv::Ptr<cv::dnn::dnn4_v20230620::BackendNode> >&)':
/build/4_x_openvino-opencl-skl-lin64/opencv/modules/dnn/src/layers/pooling_layer.cpp:619:57: error: 'v8' is not a member of 'ngraph::op'; did you mean 'v7'?
619 | max_pool = std::make_shared<ngraph::op::v8::MaxPool>(ieInpNode, ngraph::Strides(strides), ngraph::Strides(dilations),
| ^~
| v7
https://pullrequest.opencv.org/buildbot/builders/4_x_openvino-opencl-skl-lin64/builds/100029
We still use OpenVINO 2021.4
There was a problem hiding this comment.
Thanks, I will add a check
OpenVINO backend for INT8 models #23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (#24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (#24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
OpenVINO backend for INT8 models opencv#23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (opencv#24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (opencv#24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
TFLite models on different backends (tests and improvements) opencv#24039 ### Pull Request Readiness Checklist * MaxUnpooling with OpenVINO * Fully connected with transposed inputs/weights with OpenVINO * Enable backends tests for TFLite (related to opencv#23992 (comment)) * Increase existing tests thresholds See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
OpenVINO backend for INT8 models opencv#23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (opencv#24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (opencv#24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
TFLite models on different backends (tests and improvements) opencv#24039 ### Pull Request Readiness Checklist * MaxUnpooling with OpenVINO * Fully connected with transposed inputs/weights with OpenVINO * Enable backends tests for TFLite (related to opencv#23992 (comment)) * Increase existing tests thresholds See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
OpenVINO backend for INT8 models opencv#23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (opencv#24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (opencv#24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
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.