2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

 / 详情

[lite] 模型转换单算子depthToSpace ONNX,报错

DONE
Bug-Report
创建于  
2024-05-23 15:43
name about labels
Bug Report Use this template for reporting a bug bug

Describe the current behavior / 问题描述 (Mandatory / 必填)

对含有depthToSpace单算子的ONNX进行模型转换时,报错

Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU/kirin/等其他芯片

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (e.g., 1.7.0.Bxxx) :
    -- Python version (e.g., Python 3.7.5) :
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    -- GCC/Compiler version (if compiled from source):

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph

Related testcase / 关联用例 (Mandatory / 必填)

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 构造单算子onnx
  2. 模型转换$Convert --modelFile=depth_to_space.onnx --fmk=ONNX --optimize=ascend_oriented --inputShape="NCHW:1,12,480,270" --outputFile=depth_to_space
  3. 报错

或者使用业务模型指定的一个shape进行转换。
$Convert --modelFile=new_srv3_13R.onnx --fmk=ONNX --optimize=ascend_oriented --inputShape="modelInput:1,3,960,540" --outputFile=srv3_static
报错内容一致

Describe the expected behavior / 预期结果 (Mandatory / 必填)

转换ok,精度ok

Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

 [ERROR] ME(1859977,ffff7da00010,converter_lite):2024-05-23-14:15:56.307.401 [mindspore/ccsrc/cxx_api/model/acl/model_converter.cc:108] BuildAirModel] Call aclgrphBuildModel fail: EE1001: 2024-05-23-14:15:56.307.209 The argument is invalid.Reason: rtGetDevMsg execute failed, reason=[context pointer null]
        Solution: 1.Check the input parameter range of the function. 2.Check the function invocation relationship.
        TraceBack (most recent call last):
        Depth size must be divisible by block_size * block_size,but got depth[270], block_size[2], data_format[NHWC][FUNC:VerifyDepthToSpaceInputShape][FILE:transformation_ops.cc][LINE:1718]
        Verifying /pixel_shuffle/DepthToSpace failed.[FUNC:InferShapeAndType][FILE:infershape_pass.cc][LINE:132]
        Call InferShapeAndType for node:/pixel_shuffle/DepthToSpace(DepthToSpace) failed[FUNC:Infer][FILE:infershape_pass.cc][LINE:120]
        process pass InferShapePass on node:/pixel_shuffle/DepthToSpace failed, ret:4294967295[FUNC:RunPassesOnNode][FILE:base_pass.cc][LINE:570]
        build graph failed, graph id:0, ret:1343242270[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1615]
        ctx is NULL![FUNC:GetDevErrMsg][FILE:api_impl.cc][LINE:4872]
        The argument is invalid.Reason: rtGetDevMsg execute failed, reason=[context pointer null]

Special notes for this issue/备注 (Optional / 选填)

评论 (6)

emmmmtang 创建了Bug-Report

Please assign maintainer to check this issue.
请为此issue分配处理人。
@emmmmtang

感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:

  1. 如果您刚刚接触MindSpore,或许您可以在教程找到答案
  2. 如果您是资深Pytorch用户,您或许需要:
  1. 如果您遇到动态图问题,可以设置set_context(pynative_synchronize=True)查看报错栈协助定位
  2. 模型精度调优问题可参考官网调优指南
  3. 如果您反馈的是框架BUG,请确认您在ISSUE中提供了MindSpore版本、使用的后端类型(CPU、GPU、Ascend)、环境、训练的代码官方链接以及可以复现报错的代码的启动方式等必要的定位信息
  4. 如果您已经定位出问题根因,欢迎提交PR参与MindSpore开源社区,我们会尽快review
emmmmtang 修改了描述
emmmmtang 添加了
 
master
标签
emmmmtang 添加了
 
br_infer
标签
emmmmtang 添加了
 
sig/mslite
标签
emmmmtang 修改了描述
emmmmtang 负责人设置为emmmmtang

fawhere
$Convert --modelFile=depth_to_space.onnx --fmk=ONNX --optimize=ascend_oriented --inputShape="NCHW:1,12,480,270" --outputFile=depth_to_space
bugfix之后
$Benchmark --modelFile=depth_to_space.mindir --device=Ascend --inDataFile=data_depth_1_12_480_270/input.bin0 --benchmarkDataFile=data_depth_1_12_480_270/model.onnx.out
精度偏差: 0.0174559%

$Convert --modelFile=new_srv3_13R.onnx --fmk=ONNX --optimize=ascend_oriented --inputShape="modelInput:1,3,960,540" --outputFile=srv3_static_bugfix

$Benchmark --modelFile=srv3_static_bugfix.mindir --device=Ascend --inputShape="modelInput:1,3,960,540" --inDataFile=data_srv_960_540/input.bin0 --benchmarkDataFile=data_srv_960_540/model.onnx.out

i-robot 添加了
 
wenote
标签
emmmmtang 任务状态TODO 修改为VALIDATION
emmmmtang 添加协作者emmmmtang
emmmmtang 负责人emmmmtang 修改为fengyue25
emmmmtang 取消协作者emmmmtang
emmmmtang 添加协作者emmmmtang
emmmmtang 添加协作者188******92
emmmmtang 添加了
 
rca/algorithm
标签
emmmmtang 添加了
 
ctl/componenttest
标签
emmmmtang 添加了
 
rct/bugfix
标签
emmmmtang 移除了
 
br_infer
标签

Appearance & Root Cause

onnx depthToSpace算子无format属性,传到cann算子中使用默认的值,NHWC,与实际不符

Fix Solution

将正确的onnx值传给cann

Fix Description & Test Suggestion

使用合入后的包进行模型转换,功能与精度ok

Self-test Report & DT Review

本地ci看护该客户模型

emmmmtang 添加了
 
v2.3.0
标签

回归通过
【版本包】
http://mindspore-pkg.csi.rnd.huawei.com/OpenSource/Release/MindSpore/2.3.0/B523/Publish//mindspore/lite/release/linux/aarch64/cloud_fusion/python37//mindspore-lite-2.3.0-linux-aarch64.tar.gz
【测试信息】
depth_to_space

./converter_lite --fmk=ONNX --modelFile=/usr1/mindspore_data/commerical/opensource/depth_to_space/depth_to_space.onnx --outputFile=depth_to_space --optimize=ascend_oriented --inputShape="NCHW:1,12,480,270"
CONVERT RESULT SUCCESS:0
./benchmark --modelFile=/home/cy/bugfix/converter/depth_to_space.mindir --device=Ascend --inDataFile=/home/cy/bugfix/benchmark_test/benchmark_data/data_depth_1_12_480_270/input.bin0 --benchmarkDataFile=/home/cy/bugfix/benchmark_test/benchmark_data/data_depth_1_12_480_270/model.onnx.out
ModelPath = /home/cy/bugfix/converter/depth_to_space.mindir
ModelType = MindIR
InDataPath = /home/cy/bugfix/benchmark_test/benchmark_data/data_depth_1_12_480_270/input.bin0
GroupInfoFile =
ConfigFilePath =
InDataType = bin
LoopCount = 10
DeviceType = Ascend
AccuracyThreshold = 0.5
CosineDistanceThreshold = -1.1
WarmUpLoopCount = 3
NumThreads = 2
InterOpParallelNum = 1
Fp16Priority = 0
EnableParallel = 0
calibDataPath = /home/cy/bugfix/benchmark_test/benchmark_data/data_depth_1_12_480_270/model.onnx.out
EnableGLTexture = 0
cpuBindMode = HIGHER_CPU
CalibDataType = FLOAT
start unified benchmark run
PrepareTime = 1223.62 ms
MarkAccuracy
InData 0: 0.364171 0.104484 0.357267 -0.0655353 0.0982031 -0.803373 -0.380037 -0.893868 0.0886148 -0.781191 -0.966685 -0.280042 0.703824 0.594618 0.44207 -0.846361 0.744774 0.0686608 0.957199 -0.744097
================ Comparing Output data ================
Data of node output : 0.364258 0.603516 0.104492 0.553223 0.357178 0.204956 -0.0655518 0.245361 0.0982056 -0.491943 -0.803223 0.279541 -0.380127 0.521973 -0.894043 0.181396 0.088623 -0.580078 -0.78125 -0.5625 -0.966797 0.21106 -0.280029 -0.552246 0.703613 -0.0445557 0.594727 -0.824219 0.442139 -0.925293 -0.846191 0.959961 0.744629 -0.953613 0.0686646 -0.489502 0.957031 0.500977 -0.744141 0.740723 0.485596 0.262451 -0.708008 -0.238892 -0.220459 0.294189 -0.847168 -0.161865 0.793457 -0.282227
Mean bias of node/tensor output : 0.0174559%
Mean bias of all nodes/tensors: 0.0174559%
=======================================================

Run Benchmark depth_to_space.mindir Success.

new_srv3_13R.onnx

./converter_lite --fmk=ONNX --modelFile=/usr1/mindspore_data/commerical/opensource/new_srv3_13R/new_srv3_13R.onnx --optimize=ascend_oriented --inputShape="modelInput:1,3,960,540" --outputFile=new_srv3_13R
CONVERT RESULT SUCCESS:0
./benchmark --modelFile=/home/cy/bugfix/converter/new_srv3_13R.mindir --device=Ascend --inDataFile=/home/cy/bugfix/benchmark_test/benchmark_data/data_srv_960_540/input.bin0 --benchmarkDataFile=/home/cy/bugfix/benchmark_test/benchmark_data/data_srv_960_540/model.onnx.out --inputShape="modelInput:1,3,960,540"
ModelPath = /home/cy/bugfix/converter/new_srv3_13R.mindir
ModelType = MindIR
InDataPath = /home/cy/bugfix/benchmark_test/benchmark_data/data_srv_960_540/input.bin0
GroupInfoFile =
ConfigFilePath =
InDataType = bin
LoopCount = 10
DeviceType = Ascend
AccuracyThreshold = 0.5
CosineDistanceThreshold = -1.1
WarmUpLoopCount = 3
NumThreads = 2
InterOpParallelNum = 1
Fp16Priority = 0
EnableParallel = 0
calibDataPath = /home/cy/bugfix/benchmark_test/benchmark_data/data_srv_960_540/model.onnx.out
EnableGLTexture = 0
cpuBindMode = HIGHER_CPU
CalibDataType = FLOAT
Resize Dims: 1 3 960 540
start unified benchmark run
PrepareTime = 1245.28 ms
MarkAccuracy
InData 0: -0.388424 0.021017 -0.736197 -0.0876049 -0.930385 0.457549 0.997538 -0.371681 -0.0506492 -0.549216 -0.53729 -0.911807 -0.35463 -0.182228 0.965483 -0.993927 0.70819 -0.773065 0.181059 -0.328984
================ Comparing Output data ================
Data of node modelOutput : -0.37915 -0.264893 -0.0542603 -0.139404 -0.539062 -0.55957 -0.212524 -0.260742 -0.700684 -0.569336 0.126709 0.635742 0.891602 0.69043 0.0195618 -0.240112 -0.137329 -0.145386 -0.381348 -0.494141 -0.494141 -0.61377 -0.757324 -0.721191 -0.450439 -0.291992 -0.212769 0.134033 0.734375 0.524902 -0.453125 -0.503906 0.304932 0.376709 -0.385986 -0.514648 0.0183411 0.104614 -0.181274 -0.365967 -0.505859 -0.476318 -0.272949 -0.307861 -0.69873 -0.817871 -0.648438 -0.60498 -0.68457 -0.462402
Mean bias of node/tensor modelOutput : 0.432063%
Mean bias of all nodes/tensors: 0.432063%
=======================================================

Run Benchmark new_srv3_13R.mindir Success.
i-robot 添加了
 
mindspore-pkg
标签
i-robot 添加了
 
mindspore/lite
标签
i-robot 添加了
 
mindspore-lite
标签
fengyue25 任务状态VALIDATION 修改为DONE

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(4)
1047665 null 331 6668 1578939084
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助

344bd9b3 5694891 D2dac590 5694891