FaceNet仓库的MTCNN模型转换报错。
路径为:ACL_PyTorch/contrib/cv/face/FaceNet/,已经安装readme.md安装CANN8.0.RC2以及pytorch2.1.0和pytorch2.1.0-post6,但是还是报错,具体报错信息如下:
一、问题现象(附报错日志上下文):
在使用atc命令做模型转换的时候报错,报错信息如下:
使用动态shape:
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[1~32,3,1~1500,1~1500]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10002: 2025-03-24-15:14:07.029.043 Value [[1~32,3,1~1500,1~1500]] for parameter [--input_shape] is invalid. Reason: after split shape by ":", the shape must contains two parts: name and value. The value must be formatted as ["input_name1:n1~n2,c1,h1,w1"].
Solution: The valid format is [input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2]. Replace [input_name#] with node names. Ensure that the shape values are integers.
使用固定shape:
atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[32,3,128,128]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10014: 2025-03-24-15:11:03.877.515 Value [[32] for parameter [--input_shape] is invalid.
Solution: Run the "atc -h" command to view the usage. For details, see ATC Instructions.
TraceBack (most recent call last):
ParseInputShape failed for image:[32,3,128,128][FUNC:InitDomiOmgContext][FILE:omg.cc][LINE:575]
二、软件版本:
-- CANN 版本 (e.g., CANN 3.0.x,5.x.x): 8.0.RC2/
--Tensorflow/Pytorch/MindSpore 版本:
facenet-pytorch 2.1.0
mindietorch 1.0rc2+torch2.1.0.abi0
torch 2.1.0+cpu
torch-npu 2.1.0.post6.dev20240716
torchvision 0.14.1
--Python 版本 (e.g., Python 3.7.5): Python 3.10.2
-- MindStudio版本 (e.g., MindStudio 2.0.0 (beta3)):未使用
--操作系统版本 (e.g., Ubuntu 18.04):Ubuntu 22.04 LTS
三、测试步骤:
1、安装CANN8.0.RC2、24.1.rc2驱动及配套固件;
2、安装pytorch、pytorch-npu及其相关的依赖包;
3、下来ModelZoo-Pytorch代码仓,并且根据ACL_PyTorch/contrib/cv/face/FaceNet/README.md操作指导安装相关的依赖;
4、使用atc转换模型报错。
四、日志信息:
请根据自己的运行环境参考以下方式搜集日志信息,如果涉及到算子开发相关的问题,建议也提供UT/ST测试和单算子集成测试相关的日志。
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[1~32,3,1~1500,1~1500]' --log=debug --soc_version=Ascend310P3 --log=error
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10002: 2025-03-24-15:09:33.820.226 Value [[1~32,3,1~1500,1~1500]] for parameter [--input_shape] is invalid. Reason: after split shape by ":", the shape must contains two parts: name and value. The value must be formatted as ["input_name1:n1~n2,c1,h1,w1"].
Solution: The valid format is [input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2]. Replace [input_name#] with node names. Ensure that the shape values are integers.
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[1~32,3,1~1500,1~1500]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10002: 2025-03-24-15:09:49.079.020 Value [[1~32,3,1~1500,1~1500]] for parameter [--input_shape] is invalid. Reason: after split shape by ":", the shape must contains two parts: name and value. The value must be formatted as ["input_name1:n1~n2,c1,h1,w1"].
Solution: The valid format is [input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2]. Replace [input_name#] with node names. Ensure that the shape values are integers.
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[1~32,3,128,1280]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10002: 2025-03-24-15:10:32.590.254 Value [[1~32,3,128,1280]] for parameter [--input_shape] is invalid. Reason: after split shape by ":", the shape must contains two parts: name and value. The value must be formatted as ["input_name1:n1~n2,c1,h1,w1"].
Solution: The valid format is [input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2]. Replace [input_name#] with node names. Ensure that the shape values are integers.
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[32,3,128,1280]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10014: 2025-03-24-15:10:43.751.912 Value [[32] for parameter [--input_shape] is invalid.
Solution: Run the "atc -h" command to view the usage. For details, see ATC Instructions.
TraceBack (most recent call last):
ParseInputShape failed for image:[32,3,128,1280][FUNC:InitDomiOmgContext][FILE:omg.cc][LINE:575]
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[32,3,128,128]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10014: 2025-03-24-15:11:03.877.515 Value [[32] for parameter [--input_shape] is invalid.
Solution: Run the "atc -h" command to view the usage. For details, see ATC Instructions.
TraceBack (most recent call last):
ParseInputShape failed for image:[32,3,128,128][FUNC:InitDomiOmgContext][FILE:omg.cc][LINE:575]
root@localhost:/work/deepseek/embed_rerank/ModelZoo-PyTorch/ACL_PyTorch/contrib/cv/face/FaceNet# atc --framework=5 --model=./weights/PNet_truncated_fix.onnx --output=./weights/PNet_dynamic --input_format=NCHW --input_shape='image:[1~32,3,1~1500,1~1500]' --log=debug --soc_version=Ascend310P3 --log=debug
ATC start working now, please wait for a moment.
...
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E10002: 2025-03-24-15:14:07.029.043 Value [[1~32,3,1~1500,1~1500]] for parameter [--input_shape] is invalid. Reason: after split shape by ":", the shape must contains two parts: name and value. The value must be formatted as ["input_name1:n1~n2,c1,h1,w1"].
Solution: The valid format is [input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2]. Replace [input_name#] with node names. Ensure that the shape values are integers.
日志提供方式:
将日志打包后作为附件上传。若日志大小超出附件限制,则可上传至外部网盘后提供链接。
获取方法请参考wiki:
https://gitee.com/ascend/modelzoo/wikis/如何获取日志和计算图?sort_id=4097825