Ask Your Question
0

OpenCV DNN net.forward giving segmentation fault.

asked 2020-05-23 16:15:43 -0500

Himant gravatar image

updated 2020-05-23 21:18:14 -0500

supra56 gravatar image

I am using OpenVino recent kit : l_openvino_toolkit_runtime_raspbian_p_2020.2.120.tgz Raspberry - Pi4. Open CV 4.3.0-openvino.

Trying to use the OpenCV DNN with tensorflow net and also caffe. But getting segmentation fault at net.forward() call.

I am using ssd inception v2 .

Below is the code for tensorflow in Python . I do not know how to proceed and resolve it. I tried searching and could not find a working solution for this.

Steps I am doing ( the paths are configured correctly )

Initialize the tensorflow net

tensorflowNet = cv2.dnn.readNetFromTensorflow(PATH_TO_CKPT, PATH_TO_LABELS)

tensorflowNet.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD) ## set to use the NCS2

PASS THE BLOB TO TENSORFLOW NETWORK

blob = cv2.dnn.blobFromImage(frame, size=(300, 300), swapRB=True, crop=False)

pass the blob through the network and obtain the detections and

tensorflowNet.setInput(blob)

print ("Before forward")

detections =tensorflowNet.forward()

print("after forward")

It fails at .forward method.Console out put is as below.

pi@raspberrypi:~/guardeyelite $ python3 OpenCVTensorFlow.py Frame found

processing frame done

Before forward

Segmentation fault

I do not know how to proceed

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2020-05-26 07:01:09 -0500

Rok gravatar image

Hi, I faced the same problem couple of weeks ago.. I canno't find the ticket issue right now, but latest openvino has a bug on ARM architecture, so you cannot use it at the moment. I had to switch back to the previous release compiling by myself Opencv (in order to use the 4.3.0 version, because openvino comes with 4.2.0). In addition ssd inception v2 is not supported by the myriad plugin so you can not use it with target MYRIAD, but only in CPU.. but sadly the story is not over.. Openvino support inference only on intel CPUs at the moment.. so not on raspberry ! Your only option to use ssd inception v2 is to use opencv backend in dnn module, so you don't even need openvino!

edit flag offensive delete link more
0

answered 2020-06-03 02:34:51 -0500

Himant gravatar image

True. I managed to use SSD2 suprisingly. With the openvino tool kit from jan,2020.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2020-05-23 16:15:43 -0500

Seen: 124 times

Last updated: May 26