OpenCV using Movidius NCS2 error using Darknet

asked 2019-11-07 16:44:05 -0600

light0090 gravatar image

I am trying to perform my custom object detector using the Intel Movidius Neural Compute Stick 2. The network that I am using is based on YOLO, and therefore has the graph structure saved as a .cfg file and the weights as a .weights file. I use OpenCV which was installed with Openvino.

More information :

  • Operating System -> Ubuntu 18.04.3 LTS
  • OpenCV => 4.1.2

My code is here :

import cv2 as cv
modelConfiguration_big = "yolov3.cfg"
modelWeights_big = "yolov3.weights"
# load network
net = cv.dnn.readNetFromDarknet(modelConfiguration_big, modelWeights_big)
net.setPreferableBackend(cv.dnn.DNN_BACKEND_INFERENCE_ENGINE)
net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)
# perform inference
frame  = cv2.imread('img_path.jpg')
blob = cv.dnn.blobFromImage(frame, 1/255, (inpWidth, inpHeight), [0,0,0], 1, crop=False)
net.setInput(blob)
outs = net.forward(getOutputsNames(net))

On running the code, I get the following error:

Traceback (most recent call last):
  File "Detector_1.py", line 236, in <module>
   outs = net_big.forward(getOutputsNames(net_big))
cv2.error: OpenCV(4.1.2-openvino) 
/home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/op_inf_engine.cpp:704: error: 
(-215:Assertion failed) Failed to initialize Inference Engine backend: Unsupported primitive of type: 
OpenCVLayer name: yolo_82 in function 'initPlugin'
edit retag flag offensive close merge delete