Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Machek__Ondrej
Beginner
457 Views

OpenVino Failed to initialize Inference Engine backend

Hi,

 I try to run my trained network. Unfortunately I get "Failed to initialize" (after 

net.forward()

~45s).

cv2.error: OpenCV(4.0.1-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/op_inf_engine.cpp:553: error: (-215:Assertion failed) Failed to initialize Inference Engine backend: AssertionFailed: _desc.totalDimSize() == _repeat * _blobFp16->size() in function 'initPlugin'

 

I converted model from ONNX. I am use Raspberry pi. Sample code worked. ONNX work fine without openVino. I want to use Neural Compute Stick 2.

 

My code:

import cv2

net = cv2.dnn.readNet("test.xml", "test.bin")
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

image = cv2.imread("test.png",0)
image_blob = cv2.dnn.blobFromImage(image, size=(512,768), ddepth=cv2.CV_8U)

net.setInput(noise_image_blob)
net.forward() 

I converted model using:

python mo.py --input_model test.onnx --input_shape (1,512,768,1) --data_type FP16

 

0 Kudos
6 Replies
Monique_J_Intel
Employee
457 Views

Hi Ondrej,

First thing I see in your code is that you are passing noise_image_blob variable to the set_input function but you've never created this variable. Is this a typo and you meant to put net.setInput(image_blob)?

Kind Regards,

Monique Jones

Machek__Ondrej
Beginner
457 Views

Hi,

 I am sorry, there should be image_blob. I made an error when I copied the code to forum. The code on device is correct. 

Best Regards,

Ondra

nikos1
Valued Contributor I
457 Views

Hi All,

Just in case noise_image_blob issue Monique found is not the only issue, the error seems to come from line 553 of https://github.com/opencv/opencv/blob/master/modules/dnn/src/op_inf_engine.cpp when trying to init myriad plugin (?)

> cv2.error: OpenCV(4.0.1-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/op_inf_engine.cpp:553: > error: (-215:Assertion failed) Failed to initialize Inference Engine backend: AssertionFailed: _desc.totalDimSize() == _repeat * _blobFp16->size() in function 'initPlugin'

Unfortunately due to https://github.com/opencv/dldt/issues/47 we cannot see what the error is; maybe input size / resource limitation?

What is the size of the model? According to https://ncsforum.movidius.com/discussion/1209/the-reason-of-setup-error-not-enough-resources-on-myriad-to-process-this-network has some limitations.

Could you try again with a lower resolution input?

Cheers,

Nikos

Machek__Ondrej
Beginner
457 Views

I tested lower resolution (128x128) but with same result. Same error.

nikos1
Valued Contributor I
457 Views

Hi Ondrej,

Sorry, just to clarify I meant to convert ONNX to IR using lower resolution input if possible, like for example:

python mo.py --input_model test.onnx --input_shape (1,256,256,1) --data_type FP16

is this what you tried or just reduced the resolution during inference? 

Otherwise is there a way for us to repro to issue and help resolve it? Could you share onnx model or IR ?

Cheers,

Nikos

457 Views

I have some problem like this, seems like that, anyone knows what that's mean?

Traceback (most recent call last):
File "openvino_real_time_object_detection.py", line 85, in 
detections = net.forward()
cv2.error: OpenCV(4.0.1-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/op_inf_engine.cpp:553: error: (-215:Assertion failed) Failed to initialize Inference Engine backend: AssertionFailed: ind >= 0 && ind < _data.size() in function 'initPlugin'

I use the 2019 version of openvino in rasbian, and I use ReadFromTensorflow for the detection script