Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

OpenCV net does not recognize BACKEND_INFERENCE_ENGINE and DNN_TARGET_MYRIAD stick as backend

Tölle__Malte
Beginner
1,418 Views

Hello,

I am trying to use the EAST-text-detector in OpenCV in Python with preferable backend DNN_BACKEND_INFERENCE_ENGINE and preferable target DNN_TARGET_MYRIAD.

net = cv2.dnn.readNet('frozen_east_text_detection.pb')

net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

layerNames = [
    "feature_fusion/Conv_7/Sigmoid",
    "feature_fusion/concat_3"
]

When doing a forward pass:

blob = cv2.dnn.blobFromImage(image, 1.0, (newW, newH),
        (123.68, 116.78, 103.94), swapRB=True, crop=False)
net.setInput(blob)
(scores, geometry) = net.forward(layerNames)

It gives the following error:

cv2.error: OpenCV(4.1.0) /io/opencv/modules/dnn/src/dnn.cpp:1009: error: (-215:Assertion failed) haveInfEngine() in function 'wrapMat'

OpenVino is installed. What might be the problem?

0 Kudos
3 Replies
Maksim_S_Intel
Employee
1,418 Views

Please provide your OpenCV version:

print(cv2.__version__)

 

0 Kudos
Tölle__Malte
Beginner
1,418 Views

4.1.0

WITH_INF_ENGINE is set to True InferenceEngine_DIR is set to /opt/intel/computer_vision_sdk/inference_engine/share. The used version is from 2018.

0 Kudos
Maksim_S_Intel
Employee
1,418 Views

I assume you've built OpenCV by yourself and you are not using the one installed with OpenVINO. What is your cmake output? Does it contain "Inference Engine: YES" line? Run the following command and verify:

print(cv2.getBuildInformation())

If it does not say "YES", make sure you are using compatible version of Inference Engine, 4.1.0 is rather old version. Also don't forget to set cmake option "INF_ENGINE_RELEASE" to the correct version, e.g. "2019010000" for OpenVINO 2019 R1.0.0.

0 Kudos
Reply