cv :: dnn :: Layer :: forward在特定图层上不起作用(python)

时间:2019-07-17 12:09:33

标签: opencv neural-network openvino

我正在使用python中的openvino工具包进行头部位置估计。 我按如下方式加载网络:

weights_headpose = 'head-pose-estimation-adas-0001-2018-FP32.bin'
config_headpose = 'head-pose-estimation-adas-0001-2018-FP32.xml'
model_headpose = cv.dnn.readNet(weights_headpose, config_headpose)

以下

print(model_headpose.getLayerNames())

给予:

['angle_p_fc', 'angle_r_fc', 'angle_y_fc']

当我跑步时:

>print(model_headpose.forward('angle_y_fc'))

我得到了预期的浮动;
但是当我跑步时

print(model_headpose.forward('angle_p_fc'))

print(model_headpose.forward('angle_r_fc'))

我收到以下错误:

cv2.error: OpenCV(4.1.0-openvino) C:\jenkins\workspace\OpenCV\OpenVINO\build\opencv\modules\dnn\src\op_inf_engine.cpp:688: error: (-215:Assertion failed) !isInitialized() in function 'cv::dnn::InfEngineBackendNet::initPlugin'

这些层是否未初始化?有人可以帮帮我吗?预先感谢!

1 个答案:

答案 0 :(得分:0)

我的问题通过使用model_headpose.forward(['angle_p_fc', 'angle_r_fc', 'angle_y_fc'])

解决了