name | about | labels |
---|---|---|
Bug Report | Use this template for reporting a bug | bug |
对含有depthToSpace单算子的ONNX进行模型转换时,报错
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
或者使用业务模型指定的一个shape进行转换。
$Convert --modelFile=new_srv3_13R.onnx --fmk=ONNX --optimize=ascend_oriented --inputShape="modelInput:1,3,960,540" --outputFile=srv3_static
报错内容一致
转换ok,精度ok
[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]
Please assign maintainer to check this issue.
请为此issue分配处理人。
@emmmmtang
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:
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
onnx depthToSpace算子无format属性,传到cann算子中使用默认的值,NHWC,与实际不符
将正确的onnx值传给cann
使用合入后的包进行模型转换,功能与精度ok
本地ci看护该客户模型
回归通过
【版本包】
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.
登录 后才可以发表评论