Community
cancel
Showing results for 
Search instead for 
Did you mean: 
194 Views

Error setting DNN_BACKEND_INFERENCE_ENGINE with Opencv and Pyqt5

Hello everbody

i have an app where I use Pyqt5 GUI and run:

self.net = cv2.dnn.readNetFromCaffe("no_bn.prototxt", "no_bn.caffemodel")

If I set self.net.setPreferableBackend(cv2.dnn.DNN_BACKEND_OPENCV), my GUI works perfect

If I set self.net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE), this following error appear:

File "/home/piscicultura/Documentos/contadorr/defDetect.py", line 25, in detect
    detections = net.forward()    
cv2.error: OpenCV(4.1.0-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/op_inf_engine.cpp:747: error: (-215:Assertion failed) Failed to initialize Inference Engine backend: aspect_ratio param can't be equal to zero in function 'initPlugin'

But when I run everthing out of the GUI, in pure Python opencv, BACKEND_INFERENCE_ENGINE works perfect too.

I am using l_openvino_toolkit_p_2019.1.133 and OpenCV(4.1.0-openvino)

Thanks if someone could help me.

0 Kudos
2 Replies
Shubha_R_Intel
Employee
194 Views

Dear Madureira, Anderson Luiz, This forum is for OpenVino topics such as those related to Model Optimizer or Inference Engine. For OpenCV related questions, please post your question to here:

https://answers.opencv.org/questions/

Thanks,

Shubha

 

Scott_W_Intel
Employee
194 Views

This could be related to your locale, specifically your default distro "LC_NUMERIC" setting. This can cause a conflict with certain POSIX functions which can mess with data type conversion and math functions. Try adding the following to your application:

 

import locale

locale.setlocale(locale.LC_NUMERIC, 'C')

 

More info: https://doc.qt.io/qt-5/qcoreapplication.html#locale-settings

Reply