diff --git "a/AscendPytorch\346\250\241\345\236\213\346\216\250\347\220\206\344\274\227\346\231\272FAQ.md" "b/AscendPytorch\346\250\241\345\236\213\346\216\250\347\220\206\344\274\227\346\231\272FAQ.md" index 55b39e877ea24e80795411ec306821bbba1b3b6f..5629481dbc79bb34d947a5bfa8e7f611c0647ac3 100644 --- "a/AscendPytorch\346\250\241\345\236\213\346\216\250\347\220\206\344\274\227\346\231\272FAQ.md" +++ "b/AscendPytorch\346\250\241\345\236\213\346\216\250\347\220\206\344\274\227\346\231\272FAQ.md" @@ -128,6 +128,7 @@ x = F.adaptive_avg_pool2d(input, output_size=bin_size)替换为x = adaptive_avg_ 修改/etc/sudoers将Defaults env_reset改成Defaults !env_reset 修改/etc/bash.bashrc添加alias sudo='sudo env PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH' ``` + ### FAQ14、推理性能不达标,profiling显示TransData算子耗时,参考如下方案优化 (1)修改five_2_four.py优化方法 在环境变量env.sh中export install_path=/usr/local/Ascend/ascend-toolkit/latest路径下查找five_2_four.py文件,路径一般为 @@ -177,6 +178,49 @@ atc转换时指定输出节点类型为float16 atc --framework=5 --model=./ICNet.onnx --output=ICNet_bs1 --out_nodes="Resize_317:0" --output_type=FP16 --input_format=NCHW --input_shape="actual_input_1: 1,3,1024,2048" --log=debug --soc_version=Ascend310 ``` +### FAQ15、onnx转om模型报错atc命令ERROR问题解决 +* 现象描述 + ``` + ATC run failed,please check the detail log. try 'atc --help' + E19999: Inter Error! + Unknown error occurred,please check the log. + ``` + 1. 设置环境变量 + ``` + export install_path=/usr/local/Ascend/ascend-toolkit/latest + export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH + export PYTHONPATH=${install_path}/atc/python/site-packages:$PYTHONPATH + export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH + export ASCEND_OPP_PATH=${install_path}/opp + ``` +2. 更新最新的推理包run包 + +3. 打印host日志 + ``` + export ASCEND_SLOG_PRINT_TO_STDOUT=1 + [WARNING] TBE(3112,atc.bin):2021-05-25-15:20:33.329.360 [image_ops.cc:2146][OP_PROTO] ResizeNearestInferShape:2146 OpName:[Resize_140] "Get + constValue failed of [sizes]" + [ERROR] TBE(3112,atc.bin):2021-05-25-15:20:33.329.371 [image_ops.cc:2084][OP_PROTO] CalculateSizeOut:2084 OpName:[Resize_140] "length of scale_out + after erase must be equal to 2" + [ERROR] TBE(3112,atc.bin):2021-05-25-15:20:33.329.376 [image_ops.cc:2155][OP_PROTO] ResizeNearestInferShape:2155 OpName:[Resize_140] "calculate size + out failed." + [ERROR] GE(3112,atc.bin):2021-05-25-15:20:33.329.391 [op_desc.cc:1345]3112 CallInferFunc: ErrorNo: -1(failed) [COMP][PRE_OPT]Resize_140 call infer + func. ret: 4294967295 + [ERROR] GE(3112,atc.bin):2021-05-25-15:20:33.329.397 [shape_refiner.cc:766]3112 InferShapeAndType: ErrorNo: -1(failed) [COMP][PRE_OPT]Resize_140 call + infer function failed. + ``` + 得出的结论为:onnx不支持 constValuse 需要进行优化转换 + 优化转换采用onnx-simplifier 工具进行转换 + 安装onnx-simplifier + pip3 install onnx-simplifier + 简化onnx模型: + python3 -m onnxsim ./hrnet_w18.onnx ./hrnet_w18_1.onnx --input-shape "16,3,224,224" + 转换完成再执行如下命令 + ``` + atc --framework=5 --model=./hrnet_w18_1.onnx --input_format=NCHW --input_shape="image:16,3,224,224" --output=hrnet_bs16 --log=debug -- + soc_version=Ascend310 + ``` + onnx转om成功。 ## [2.2 NPU模型精度调试常见问题FAQ](#22-NPU模型精度调试常见问题FAQ) diff --git a/mobilenet_w18_bs32.rar b/mobilenet_w18_bs32.rar new file mode 100644 index 0000000000000000000000000000000000000000..854a3f8d55ac0ac511d5a0b449538c3b2cb99a27 Binary files /dev/null and b/mobilenet_w18_bs32.rar differ