迁移到 OpenVINO™ API 2.0 以使用动态形状
- 推理了自定义 YOLOv5,但收到错误:
RuntimeError: Check 'std::get<0>(valid)' failed at inference/src/ie_core.cpp:1414:
InferenceEngine::Core::LoadNetwork doesn't support inputs having dynamic shapes. Use ov::Core::compile_model API instead. Dynamic inputs are :{ input:'images,images', shape={?,3,?,?}} - 推断自定义 mobilenetV2,但收到错误:
RuntimeError: [GENERAL_ERROR] /home/jenkins/agent/workspace/private-ci/ie/build-linux-ubuntu20/b/repos/openvino/inference-engine/src/vpu/common/src/ngraph/transformations/dynamic_to_static_shape.cpp:48 DynamicToStaticShape transformation: got dynamic rank for StatefulPartitionedCall/mobilenetv2_1.00_224/global_average_pooling2d_1/Mean_Squeeze__74 with type Squeeze ver. 0 while only static is supported
- 升级到 OpenVINO™ 2022.1,其中引入了新的 OpenVINO™ API 2.0。
- 使用 ov::Core:compile_model 执行模型。
- 请参考 ov::CompiledModel 和 Dynamic Shape 类。