MindSpore Lite不支持dynamic input shape/dynamic axes
收藏回复举报
MindSpore Lite不支持dynamic input shape/dynamic axes
t('forum.solved') 已解决
新人帖
发表于2024-04-10 16:10:31
0 查看

onnx是支持dynamic input shape/dynamic axes的,但是MindSpore Lite不支持。

converter转换后,dynamic input shape/dynamic axes都变成-1,然后加载失败。

[mindspore/lite/src/runtime/scheduler.cc:928] InferSubGraphShape# InferShape failed, name: /model/decoder/Squeeze, type: Squeeze
[mindspore/lite/src/runtime/scheduler.cc:281] SchedulePreProcess# op infer shape failed.
[mindspore/lite/src/runtime/lite_session.cc:574] CompileGraph# Schedule kernels failed: -500
[mindspore/lite/src/runtime/lite_session.cc:1762] LoadModelAndCompileByBuf# Compile model failed
[mindspore/lite/src/runtime/c_api/model_c.cc:77] Build# Load and compile failed

converter转换的时候带--inputShape=转换出固定shape的模型,可以正常加载,但是当尝试Resize的时候,又报错了。所以是不支持

[mindspore/lite/src/runtime/sub_graph_kernel.cc:121] ReSize# InferShape failed, type: Reshape
[mindspore/lite/src/runtime/lite_session.cc:1148] ReSizeKernels# ReSize node CpuFP32SubGraph0_0 failed
[mindspore/lite/src/runtime/sub_graph_kernel.cc:121] ReSize# InferShape failed, type: Reshape
[mindspore/lite/src/runtime/lite_session.cc:1148] ReSizeKernels# ReSize node CpuFP32SubGraph0_0 failed
[mindspore/lite/src/runtime/lite_session.cc:1249] Resize# restore kernel size fail!ret: -1

模型使用的是optimum转换出来的whisper tiny的decoder的onnx model。

以下是复现问题的模型,测试条件是使用了OpenHarmony的MindSpore Lite相关API,不过应该正常MindSpore Lite也是能复现的。

链接:https://pan.baidu.com/s/1Zm-ApLeTCDdOu4K9YPCEXQ?pwd=sj8q 提取码:sj8q

我要发帖子