Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6026 Discussions

Failed to initialize Inference Engine backend , opencv dnn

rohit12
Beginner
413 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
328 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

4 Replies
Vladimir_Dudnik
Employee
403 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.

rohit12
Beginner
339 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

Peh_Intel
Moderator
365 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

 

Vladimir_Dudnik
Employee
329 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

Reply