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

Opencv4.5.4 Inference result error #9347

Closed
XiangMichael opened this issue Dec 21, 2021 · 5 comments
Closed

Opencv4.5.4 Inference result error #9347

XiangMichael opened this issue Dec 21, 2021 · 5 comments

Comments

@XiangMichael
Copy link

System information (version)

When testing yolov3, when the inference width and height values are set differently, the inference result is wrong. For example, when inpWidth=480, inpHeight=320, the inference result is wrong; when inpWidth=320, inpHeight=320, the inference result is correct

@XiangMichael XiangMichael added bug Something isn't working support_request labels Dec 21, 2021
@jgespino jgespino removed the bug Something isn't working label Dec 21, 2021
@Iffa-Intel
Copy link

This is actually more related to your native YOLOv3 model instead of OpenVINO.
In order to overcome this issue, you'll need to train your data for non-square images.
This discussion thread might be useful to you: ultralytics/yolov3#126
and here is the tutorial for YOLOv3 non-square images: ultralytics/yolov3#232

If you are looking for a solution within OpenVINO, you may try to use the Reshape Inference Feature to change your model's input shape. You may refer to this Reshape Inference Feature documentation.

@alalek
Copy link

alalek commented Dec 22, 2021

OpenCV ticket is here: opencv/opencv#19781

@XiangMichael
Copy link
Author

XiangMichael commented Dec 24, 2021

OpenCV ticket is here: opencv/opencv#19781
When I did it according to opencv/opencv#19781, when "backendId = CV ::DNN ::DNN_BACKEND_INFERENCE_ENGINE, TargetId = CV ::DNN ::DNN_TARGET_CPU "Running result is normal, but" backendId = CV ::DNN ::DNN_BACKEND_INFERENCE_ENGINE, TargetId = CV ::DNN ::DNN_TARGET_OPENCL_FP16 "will crash directly

OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.4) Error: Unspecified error (Failed to initialize Inference Engine backend (device = GPU): Ngraph operation Transpose with name permute_16 has dynamic output shape on 0 port, but CPU plug-in supports only static shape) in cv::dnn::InfEngineNgraphNet::initPlugin, file D:\code\vs2017_major\opencv454_openvino\modules\dnn\src\ie_ngraph.cpp, line 742

@XiangMichael
Copy link
Author

XiangMichael commented Dec 24, 2021

This is actually more related to your native YOLOv3 model instead of OpenVINO. In order to overcome this issue, you'll need to train your data for non-square images. This discussion thread might be useful to you: ultralytics/yolov3#126 and here is the tutorial for YOLOv3 non-square images: ultralytics/yolov3#232

If you are looking for a solution within OpenVINO, you may try to use the Reshape Inference Feature to change your model's input shape. You may refer to this Reshape Inference Feature documentation.

When I did it according to opencv/opencv#19781, when "backendId = CV ::DNN ::DNN_BACKEND_INFERENCE_ENGINE, TargetId = CV ::DNN ::DNN_TARGET_CPU "Running result is normal, but" backendId = CV ::DNN ::DNN_BACKEND_INFERENCE_ENGINE, TargetId = CV ::DNN ::DNN_TARGET_OPENCL_FP16 "will crash directly
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.4) Error: Unspecified error (Failed to initialize Inference Engine backend (device = GPU): Ngraph operation Transpose with name permute_16 has dynamic output shape on 0 port, but CPU plug-in supports only static shape) in cv::dnn::InfEngineNgraphNet::initPlugin, file D:\code\vs2017_major\opencv454_openvino\modules\dnn\src\ie_ngraph.cpp, line 742

@Iffa-Intel Iffa-Intel added the PSE label Jan 7, 2022
@jgespino jgespino self-assigned this Feb 14, 2022
@jgespino
Copy link
Contributor

jgespino commented Mar 1, 2022

Hi @XiangMichael

Apologies for the delay, is this something you are still working on? If so, please share your model and sample code to reproduce the issue.

Regards,
Jesus

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

No branches or pull requests

5 participants