cv::dnn::Layer::forward 不适用于特定层 (python)

cv::dnn::Layer::forward does not work on specific layer (python)

我在 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'

这些层没有初始化吗?有人可以帮帮我吗?提前致谢!

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

解决