昇腾故障案例详情页

使用动态分辨率参数转模型时,其他档位设置了-1,模型转换失败

更新时间: 2023/09/12

暂无评分

问题信息

问题来源产品大类产品子类关键字
官方模型推理模型转换ATC、模型转换、动态分辨率、动态维度、shape分档

问题现象描述

使用ATC工具进行模型转换时,使用--dynamic_image_size参数转换支持多个分辨率的模型,提示E10019报错信息。

atc --model=./resnet50_tensorflow_1.7.pb --input_shape="Placeholder:-1,-1,-1,3" --dynamic_image_size="448,448;224,224" --soc_version=Ascend310 --output=./out/test --framework=3

报错信息如下:

ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10019: When [--dynamic_image_size] is included, only the height and width axes can be –1 in [--input_shape].
        Possible Cause: When [--dynamic_image_size] is included, only the height and width axes can be –1 in the shape.
        Solution: Try again with a valid [--input_shape] argument. Make sure that axes other than height and width are not –1.

原因分析

使用ATC工具进行模型转换,如果使用了--dynamic_image_size参数,shape中只有H、W支持设置为"-1",且只支持format为NCHW、NHWC格式;其他format场景,设置分辨率请使用--dynamic_dims参数。上述模型转换命令,shape中N、H、W都设置了"-1",不符合参数设置要求。

解决措施

重新设置模型转换时的参数信息,只设置shape中的H,W为"-1"。改后样例如下:

 atc --model=./resnet50_tensorflow_1.7.pb --input_shape="Placeholder:1,-1,-1,3" --dynamic_image_size="448,448;224,224" --soc_version=Ascend310 --output=./out/test --framework=3

本页内容

该页面对您有帮助吗?
我要评分