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.
6573 Discussions

Failed to initialize Inference Engine backend , opencv dnn

rohit12
Beginner
8,472 Views

I am trying to use opencv dnn module to perform object detection. I am using movidius neural compute stick with openvino toolkit. 

 

Code is as below:

# load the DNN model
model = cv2.dnn.readNet(model=model_path, config=config_path, framework='TensorFlow')

model.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)

model.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

 

Getting an error message: 

output = model.forward()
cv2.error: OpenCV(4.5.3-openvino) C:\jenkins\workspace\windows6296ace0\opencv\modules\dnn\src\ie_ngraph.cpp:738: error: (-2:Unspecified error) Failed to initialize Inference Engine backend (device = MYRIAD): Failed to allocate graph: NC_ERROR in function 'cv::dnn::InfEngineNgraphNet::initPlugin'

 

Could someone please help me resolve it. Thanks in advance.

 

 

0 Kudos
1 Solution
Vladimir_Dudnik
Employee
8,387 Views

Hello @rohit12, that's rights, in case of OpenVINO backend in OpenCV DNN you have to supply model in IR form only

Regards,
  Vladimir

View solution in original post

5 Replies
Vladimir_Dudnik
Employee
8,462 Views

@rohit12 according to error message, runtime was not able to allocate network graph on device. Potentially your model might be too big to be loaded into NCS2 device.

0 Kudos
rohit12
Beginner
8,398 Views

Hello @Vladimir_Dudnik , 

is it necessary that the model should always be in intermediate representation (IR) format that is .xml and .bin to execute it on NCS2?

In the above query I am passing .pb and .pbtxt files which is tensorflow format

0 Kudos
Peh_Intel
Moderator
8,424 Views

Hi rohit12,

 

Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.

 

 

Regards,

Peh

 

0 Kudos
Vladimir_Dudnik
Employee
8,388 Views

Hello @rohit12, that's rights, in case of OpenVINO backend in OpenCV DNN you have to supply model in IR form only

Regards,
  Vladimir

KSehairi
Novice
5,572 Views

Hello
you have to copy .dll files located on …Intel\openvino_2022.3.1\runtime\bin\intel64\Release to your cv2 folder or add this folder to system path

0 Kudos
Reply