专栏算法工具链自己的训练的yolov5,进行check,输出结果....

自己的训练的yolov5,进行check,输出结果....

已解决
孙宏伟2020-12-10
305
4

cd $(dirname $0) || exit

dirname $0

model_type="onnx"

onnx_model="/data/x3/x3_tc_1.1.17e/x3-toolchain-1.1.17e.tar/horizon_x3_tc_1.1.17e/samples/04_detection/04_yolov5_shw/yolov5s.onnx"

output="./yolov5_checker.log"

hb_mapper checker --model-type ${model_type} \

--model ${onnx_model} \

--output ${output}

2020-12-10 12:41:49,958 INFO Start hb_mapper....

2020-12-10 12:41:49,958 INFO hb_mapper version 1.1.24

2020-12-10 12:41:50,314 INFO Model type: onnx

2020-12-10 12:41:50,315 INFO output file: ./yolov5_checker.log

2020-12-10 12:41:50,315 INFO input names []

2020-12-10 12:41:50,315 INFO input shapes {}

2020-12-10 12:41:50,315 INFO Begin model checking....

2020-12-10 12:41:50,315 INFO [Thu Dec 10 12:41:50 2020] Start to Horizon NN Model Convert.

2020-12-10 12:41:50,315 INFO The input parameter is not specified, convert with default parameters.

2020-12-10 12:41:50,315 INFO The hbdk parameter is not specified, and the submodel will be compiled with the default parameter.

2020-12-10 12:41:50,315 INFO HorizonNN version: 0.7.6

2020-12-10 12:41:50,316 INFO HBDK version: 3.12.9

2020-12-10 12:41:50,316 INFO [Thu Dec 10 12:41:50 2020] Start to parse the onnx model.

2020-12-10 12:41:50,501 INFO ONNX model info:

ONNX IR version: 6

Opset version: 10

Input name: images, [1, 3, 640, 640]

2020-12-10 12:41:50,752 INFO [Thu Dec 10 12:41:50 2020] End to parse the onnx model.

2020-12-10 12:41:50,755 INFO Model input names: ['images']

2020-12-10 12:41:53,801 INFO Saving the original float model: ./.hb_check/original_float_model.onnx.

2020-12-10 12:41:53,803 INFO [Thu Dec 10 12:41:53 2020] Start to optimize the model.

2020-12-10 12:41:54,420 INFO [Thu Dec 10 12:41:54 2020] End to optimize the model.

2020-12-10 12:41:57,130 INFO Saving the optimized model: ./.hb_check/optimized_float_model.onnx.

2020-12-10 12:41:57,131 INFO [Thu Dec 10 12:41:57 2020] Start to calibrate the model.

2020-12-10 12:41:57,436 INFO [Thu Dec 10 12:41:57 2020] End to calibrate the model.

2020-12-10 12:41:57,441 INFO [Thu Dec 10 12:41:57 2020] Start to quantize the model.

2020-12-10 12:41:59,162 INFO [Thu Dec 10 12:41:59 2020] End to quantize the model.

2020-12-10 12:42:05,826 INFO Saving the quantized model: ./.hb_check/quantized_model.onnx.

2020-12-10 12:42:05,827 INFO [Thu Dec 10 12:42:05 2020] Start to compile the model with march bernoulli2.

2020-12-10 12:42:06,818 INFO Compile submodel: torch-jit-export_subgraph_0

01_check.sh: line 19: 27513 Segmentation fault (core dumped) hb_mapper checker --model-type ${model_type} --model ${onnx_model} --output ${output}

这就成功了?为何没看到算子检测列表?

算法工具链
评论1
0/1000
  • chenze
    Lv.1
    你好,您这边可能踩到一个已知bug,这边帮忙做一下模型转换,然后再提供转换的日志哈,谢谢。
    如果日志太大,你可以直接邮件我:ze.chen@horizon.ai
    2020-12-10
    0
    3
    • 孙宏伟回复chenze:

      /home/xxx/anaconda3/envs/yolov5/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py:266: UserWarning: You are trying to export the model with onnx:Resize for ONNX opset version 10. This operator might cause results to not match the expected results by PyTorch.

      ONNX's Upsample/Resize operator did not match Pytorch's Interpolation until opset 11. Attributes to determine how to transform the input were added in onnx:Resize in opset 11 to support Pytorch's behavior (like coordinate_transformation_mode and nearest_mode).

      We recommend using opset 11 and above for models using this operator.

      warnings.warn("You are trying to export the model with " + onnx_op + " for ONNX opset version "

      ONNX export success, saved as yolov5s.onnx

      Export complete (19.74s). Visualize with https://github.com/lutzroeder/netron.

      您好,上面是yolov5转onnx的转换输出日志

      2020-12-10
      0
    • 我是韩冬回复chenze:
      您好,我也遇到了同样的问题,使用的模型是ppyoloe+,check也遇到了这个日志输出的错误,您看这个问题该怎么解决,感谢!!!
      [root@ced2629d1e2b mapper]# bash 01_check_ppyoloe+.sh

      ++ dirname 01_check_ppyoloe+.sh

      + cd .

      + output=./efficientnet_lite0_checker.log

      + model_type=onnx

      + onnx_model=./on/ppyoloe+.onnx

      + hb_mapper checker --model-type onnx --model ./on/ppyoloe+.onnx --output ./efficientnet_lite0_checker.log

      2022-12-08 11:36:02,144 INFO Start hb_mapper....

      2022-12-08 11:36:02,144 INFO log will be stored in /data/ai_toolchain/horizon_model_convert_sample/03_classification/05_efficientnet_lite0_onnx/mapper/hb_mapper_checker.log

      2022-12-08 11:36:02,144 INFO hbdk version 3.27.1

      2022-12-08 11:36:02,144 INFO horizon_nn version 0.12.8

      2022-12-08 11:36:02,144 INFO hb_mapper version 1.5.5

      2022-12-08 11:36:02,144 WARNING parameter [output] is deprecated

      2022-12-08 11:36:02,248 INFO Model type: onnx

      2022-12-08 11:36:02,248 INFO input names []

      2022-12-08 11:36:02,248 INFO input shapes {}

      2022-12-08 11:36:02,249 INFO Begin model checking....

      2022-12-08 11:36:02,249 INFO [Thu Dec 8 11:36:02 2022] Start to Horizon NN Model Convert.

      2022-12-08 11:36:02,249 INFO The input parameter is not specified, convert with default parameters.

      2022-12-08 11:36:02,249 INFO The hbdk parameter is not specified, and the submodel will be compiled with the default parameter.

      2022-12-08 11:36:02,249 INFO HorizonNN version: 0.12.8

      2022-12-08 11:36:02,249 INFO HBDK version: 3.27.1

      2022-12-08 11:36:02,250 INFO [Thu Dec 8 11:36:02 2022] Start to parse the onnx model.

      2022-12-08 11:36:02,757 INFO ONNX model info:

      ONNX IR version: 7

      Opset version: 11

      Input name: image, [1, 3, 640, 640]

      2022-12-08 11:36:03,569 INFO [Thu Dec 8 11:36:03 2022] End to parse the onnx model.

      2022-12-08 11:36:03,571 INFO Model input names: ['image']

      2022-12-08 11:36:04,360 INFO Saving the original float model: ./.hb_check/original_float_model.onnx.

      2022-12-08 11:36:04,363 INFO [Thu Dec 8 11:36:04 2022] Start to optimize the model.

      2022-12-08 11:36:14,165 INFO [Thu Dec 8 11:36:14 2022] End to optimize the model.

      2022-12-08 11:36:14,935 INFO Saving the optimized model: ./.hb_check/optimized_float_model.onnx.

      2022-12-08 11:36:14,935 INFO [Thu Dec 8 11:36:14 2022] Start to calibrate the model.

      2022-12-08 11:36:16,513 INFO There are 1 samples in the calibration data set.

      2022-12-08 11:36:17,022 INFO Run calibration model with max method.

      2022-12-08 11:36:18.694682169 [W:onnxruntime:, graph.cc:2413 CleanUnusedInitializers] Removing initializer 'eager_tmp_1'. It is not used by any node and should be removed from the model.

      2022-12-08 11:36:18.694711119 [W:onnxruntime:, graph.cc:2413 CleanUnusedInitializers] Removing initializer 'eager_tmp_0'. It is not used by any node and should be removed from the model.

      2022-12-08 11:36:20,055 INFO [Thu Dec 8 11:36:20 2022] End to calibrate the model.

      2022-12-08 11:36:20,055 INFO [Thu Dec 8 11:36:20 2022] Start to quantize the model.

      2022-12-08 11:36:31,831 INFO [Thu Dec 8 11:36:31 2022] End to quantize the model.

      2022-12-08 11:36:33,683 INFO Saving the quantized model: ./.hb_check/quantized_model.onnx.

      2022-12-08 11:36:33,684 INFO [Thu Dec 8 11:36:33 2022] Start to compile the model with march bernoulli2.

      2022-12-08 11:36:33,684 INFO Parsing the hbdk parameter:{'hbdk_pass_through_params': '--O0'}

      01_check_ppyoloe+.sh: line 31: 362 Segmentation fault (core dumped) hb_mapper checker --model-type ${model_type} --model ${onnx_model} --output ${output}

      2022-12-08
      0
    • Horizon_guosheng回复我是韩冬:

      你好,可以根据我们的手册,升级版本后进行开发,看看问题是否依旧存在

      2022-12-08
      0