已关闭
[Bug]: 昇腾后端动态分档场景下调用model.resize接口后使用get_model_outputs获取到的tensor shape错误 #225
xiongpan创建于  3月5日关闭于  6月11日
xiongpan成员
3月5日 创建

Checklist


[x] 1. 我已经搜索过相关问题,但没有得到预期的帮助.

[x] 2. 最新版本中该错误尚未修复.

[x] 3. 请注意,如果您提交的Bug描述缺少相应的环境信息和最小可复现的demo,我们将很难复现和解决该问题,从而降低收到反馈的可能性,甚至该问题将被关闭.

🐞 问题详细描述

动态分档场景下调用model.resize后调用model.get_outputs接口获取的tensor shape错误,并且模型在推理后调用model.getoutputs接口无法从其中的tensor获取到推理结果,纯动态场景下直接使用get_outptus接口获取到的tensor用于推理时推理结果错误,使用如下代码测试:

import numpy as np

model = mslite.Model()
context = mslite.Context()
context.target = ["ascend"]

model.build_from_file("model.mindir",mslite.ModelType.MINDIR,context)
model.resize(model.get_inputs(),[[3,17],[3,17]])
inputs = model.get_inputs()
input_shapes = [inp.shape for inp in inputs]
print(input_shapes)
outputs = model.get_outputs()
output_shapes = [out.shape for out in outputs]
print(output_shapes)
assert output_shapes==[[3,17]]

错误的输出为[[3,17],[3,17]],[[6,20],[6,20]]且assert断言失败
正确的输出为[[3,17],[3,17]],[[3,17],[3,17]]且断言成功

详细的环境信息描述

昇腾后端

其他辅助信息

版本信息

2.9.0

Thanks for contributing 🎉!

likedislike
Xxiongpan成员
3月5日 关联分支 由 [] 改变为 [master]
Xxiongpan成员
3月5日 问题后端类型 由 [] 改变为 [Ascend]
Xxiongpan成员
3月5日 关联组件 由 [] 改变为 [B-SIG-InnerDelivery]
YeFeng_24
YeFeng_24成员
3月12日 评论:

补充一下具体报错信息以及解决方案

likedislike
Xxiongpan成员
3月12日 修改了issue 的描述
Xxiongpan成员
3月12日 修改了issue 的描述
Xxiongpan成员
3月13日 issue优先级由 无优先级 改变为 主要
YeFeng_24YeFeng_24成员
3月13日 将 xiong-pan 设为负责人
YeFeng_24
YeFeng_24成员
3月17日 评论:

相关问题已修复,issue尽快关闭

likedislike
Xxiongpan成员
6月11日 issue状态由 TODO 改变为 ACCEPTED
Xxiongpan成员
6月11日 issue状态由 ACCEPTED 改变为 WIP
Xxiongpan成员
6月11日 issue状态由 WIP 改变为 DONE
Xxiongpan成员
6月11日 关闭了 issue