nndeploy icon indicating copy to clipboard operation
nndeploy copied to clipboard

集成openvino后端,运行nndeploy_demo_detect 出现问题。

Open zzxaijs opened this issue 4 months ago • 9 comments

base::Status OpenVinoInference::reshape(base::ShapeMap &shape_map) 函数中 compiled_model_ = core_.compile_model(model, ov_device_type, properties); 在win11 和 Ubuntu20 上都 弹出 runtime_error,目前没有找不到原因。 Openvino 版本我试过 2025.02 和仓库提供python安装脚本(23.01) 都会出现runtime error ,但nndepoy_demo_detect 程序不会崩溃。 只是推理结果异常,全部检测不到。 有没有老哥见过这种现象?

zzxaijs avatar Aug 23 '25 06:08 zzxaijs

初步猜测可能是模型的问题,比如输入shape的问题

Alwaysssssss avatar Aug 25 '25 02:08 Alwaysssssss

不是模型的问题,该模型我用openvino 裸api ,能正常运行。

zzxaijs avatar Aug 25 '25 08:08 zzxaijs

建议你更多的模型相关的信息,比如yolo那个版本,你使用的模型输入shape和输出的个数、输出的shape、输出有多少个类别

Alwaysssssss avatar Aug 25 '25 08:08 Alwaysssssss

你的模型不同,你需要对应修改前后处理的参数哈

Alwaysssssss avatar Aug 25 '25 08:08 Alwaysssssss

模型就是demo\detect\README.md 中提供的https://www.modelscope.cn/models/nndeploy/nndeploy/resolve/master/detect/yolov5s.onnx。 是 core_.compile_model(model, ov_device_type, properties); 调用出现C++ runtime error.不是这个计算图的后处理,前处理啥出现问题。

zzxaijs avatar Aug 26 '25 01:08 zzxaijs

请在运行给这个模型一个确定的输入shape, 对应的后处理的 version 改成 5

Alwaysssssss avatar Aug 26 '25 02:08 Alwaysssssss

我用ubuntu20.04 默认openvino 23.01版本,进行如下指令测试,

Image

上图出现的result 0 是因为core_.compile_model(model, ov_device_type, properties); 调用出现C++ runtime error.程序依旧正常在跑,导致结果不对的。

还有,这个确定输入shape 是添加哪个指令来着

zzxaijs avatar Aug 26 '25 02:08 zzxaijs

我用windows去测试,也是一样的现象。

zzxaijs avatar Aug 26 '25 02:08 zzxaijs

建议用: demo可以暴露出来的接口有限,目前该demo暴露出来的接口是针对static shape的yolo模型做处理 建议用onnxsim给该yolov5模型固定shape[1x3x640x640]

Alwaysssssss avatar Aug 28 '25 07:08 Alwaysssssss