Prediction by dnn with IE raise segmentation fault

asked 2019-04-09 10:32:48 -0600

potoo gravatar image

I followed Intel's Deep Learning Inference Engine backend, built opencv with IE backend on my raspberry, but when I use dnn to predict my data, net.forward() will raise a error: segmentation fault.
Env:

  • Raspberry 3b+
  • OS: Raspbian 9.8
  • Python: 3.5.3
  • Opencv: 4.1.0-pre built with IE.
  • IE: 2019R1 and 2018R5 all tested
  • My device: ncs v1
  • My model: mobilenetv2-ssdlite converted by OpenVINO2018R5, tested on it's built-in opencv

build code(I didn't use docker so removed cross-compile related param):

cmake -DCMAKE_BUILD_TYPE=Release \  
  -DCMAKE_INSTALL_PREFIX=/usr/local \  
  -DOPENCV_CONFIG_INSTALL_PATH="cmake" \  
  -DWITH_IPP=OFF \  
  -DBUILD_TESTS=OFF \  
  -DBUILD_PERF_TESTS=OFF \  
  *python stuff*
  -DENABLE_NEON=ON \  
  -DCPU_BASELINE="NEON" \  
  -DWITH_INF_ENGINE=ON \  
  -DINF_ENGINE_LIB_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/lib/armv7l" \  
  -DINF_ENGINE_INCLUDE_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include" \  
  -DCMAKE_FIND_ROOT_PATH="/home/pi/inference_engine_vpu_arm/" \  
  -DENABLE_CXX11=ON ..

test code:

...
net = cv2.dnn.readNet('mymodel.xml', 'mymodel.bin')
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)
...
blob = cv2.dnn.blobFromImage(frame, size=(300, 300), crop=False)
net.setInput(blob)
out = net.forward()  # will raise error: *segmentation fault*
...

At frist, I thought it maybe was the model version's problem, cause my model converted by OpenVINO2018R5, but Opencv built with OpenVINO2019r1, so I rebuilt Opencv with OpenVINO2018r5, it still has same error.
Anything could help, thanks.

edit retag flag offensive close merge delete