专栏算法工具链J5板子上运行yolov5s,帧率太低了

J5板子上运行yolov5s,帧率太低了

已解决
地久天长2024-06-24
102
7

1. 芯片型号:J5

2. 天工开物开发包 OpenExplorer 版本:1.1.68

3. 问题定位:板端部署性能测试

4. 问题具体描述:

我们现在手里用的是立讯的EDK J5的开发板,用公版的yolov5s的模型,模型下载地址:

https://github.com/ultralytics/yolov5/releases/tag/v2.0

我将pt文件转换为onnx文件,然后通过oe将onnx转换为bin文件,然后在板子上进行性能测试,测试命令如下:

/userdata/.horizon/hrt_model_exec perf --model_file yolov5s_640x640_nv12.bin --core_id 0 --thread_num 8 --frame_count 1000

/userdata/.horizon/hrt_model_exec perf --model_file yolov5s_640x640_nv12.bin --core_id 0 --thread_num 8 --frame_count 1000

I0000 00:00:00.000000 1548 vlog_is_on.cc:197] RAW: Set VLOG level for "*" to 3

[BPU_PLAT]BPU Platform Version(1.3.3)!

[M:2000:01:01:08:02:14:573479] E: diag bpu0 vm check open

[M:2000:01:01:08:02:14:574119] E: diag bpu1 vm check open

[HBRT] set log level as 0. version = 3.15.40.0

[DNN] Runtime version = 1.22.6_(3.15.40 HBRT)

[A][DNN][packed_model.cpp:246][Model](2000-01-01,08:02:14.799.123) [HorizonRT] The model builder version = 1.21.6

Load model to DDR cost 352.981ms.

I0101 08:02:14.878170 1548 function_util.cpp:327] get model handle success

I0101 08:02:14.878227 1548 function_util.cpp:660] get model input count success

I0101 08:02:14.878331 1548 function_util.cpp:691] prepare input tensor success!

I0101 08:02:14.878359 1548 function_util.cpp:697] get model output count success

Frame count: 200, Thread Average: 303.633392 ms, thread max latency: 485.345001 ms, thread min latency: 232.539001 ms, FPS: 25.816128

Frame count: 400, Thread Average: 302.552368 ms, thread max latency: 485.345001 ms, thread min latency: 232.539001 ms, FPS: 26.224115

Frame count: 600, Thread Average: 302.123779 ms, thread max latency: 485.345001 ms, thread min latency: 232.539001 ms, FPS: 26.362705

Frame count: 800, Thread Average: 302.066528 ms, thread max latency: 485.345001 ms, thread min latency: 232.539001 ms, FPS: 26.327904

Frame count: 1000, Thread Average: 301.904694 ms, thread max latency: 485.345001 ms, thread min latency: 232.539001 ms, FPS: 26.407167


Running condition:

 Thread number is: 8

 Frame count  is: 1000

 Program run time: 37868.740000 ms

Perf result:

 Frame totally latency is: 301904.687500 ms

 Average   latency   is: 301.904694 ms

 Frame     rate      is: 26.407005 FPS

[M:2000:01:01:08:02:53:074055] E: diag bpu1 vm check close

[M:2000:01:01:08:02:53:675343] E: diag bpu0 vm check close

帧率只有25fps,不知道是哪里的问题,请指导一下。

我们现在的需求是想通过公版的yolov5s或者yolov5n转换成bin文件,在J5的板子上测试一下J5实际能跑到多高的帧率。

算法工具链
评论2
0/1000
  • kotei左文亮
    Lv.3

    先检查算子 是否都在BPU上执行

    2024-06-24
    0
    5
    • 地久天长回复kotei左文亮:

      2024-06-24 15:33:41,507 file: tool_utils.py func: tool_utils line No: 73 log will be stored in /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/hb_mapper_makertbin.log

      2024-06-24 15:33:41,507 file: hb_mapper.py func: hb_mapper line No: 127 Start hb_mapper....

      2024-06-24 15:33:41,507 file: hb_mapper.py func: hb_mapper line No: 128 hbdk version 3.48.6

      2024-06-24 15:33:41,507 file: hb_mapper.py func: hb_mapper line No: 129 horizon_nn version 0.21.2

      2024-06-24 15:33:41,507 file: hb_mapper.py func: hb_mapper line No: 130 hb_mapper version 1.21.6

      2024-06-24 15:33:41,507 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 522 Start Model Convert....

      2024-06-24 15:33:41,519 file: mapper_conf_parser.py func: mapper_conf_parser line No: 104 validating model_parameters...

      2024-06-24 15:33:41,519 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1360 Using abs path /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/01_common/model_zoo/mapper/detection/yolov5_onnx_optimized/yolov5s-v2.0.onnx

      2024-06-24 15:33:41,519 file: mapper_conf_parser.py func: mapper_conf_parser line No: 259 Using onnx model file: /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/01_common/model_zoo/mapper/detection/yolov5_onnx_optimized/yolov5s-v2.0.onnx

      2024-06-24 15:33:41,542 file: helper.py func: helper line No: 145 Model input names: ['images']

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 263 Model has 1 inputs according to model file

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1360 Using abs path /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 452 node_dict: {self.node_dict}

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 118 validating model_parameters finished

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 122 validating input_parameters...

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 506 Model name not given in yaml_file, using model name from model file: ['images']

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 550 Model input shape not given in yaml_file, using shape from model file: [[1, 3, 640, 640]]

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 652 nv12 input type rt received.

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 134 validating input_parameters finished

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 138 validating calibration_parameters...

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 957 Parameter calibration_type is skip. cal_data_dir check skipped

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 154 validating calibration_parameters finished

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 158 validating custom_op...

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1089 custom_op does not exist, skipped

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 164 validating custom_op finished

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 167 validating compiler_parameters...

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1170 Input node images's input_source not set, it will be set to pyramid by default

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 182 validating compiler_parameters finished

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 186 validating deprecated parameters...

      2024-06-24 15:33:41,542 file: mapper_conf_parser.py func: mapper_conf_parser line No: 192 validating deprecated parameters finished

      2024-06-24 15:33:41,543 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 54 Dump config:

      2024-06-24 15:33:41,543 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 55 calibration_parameters:

       cal_data_dir: ./calibration_data_rgb_f32

       cal_data_type: float32

       calibration_type: skip

      compiler_parameters:

       compile_mode: latency

       debug: true

       optimize_level: O3

      input_parameters:

       input_layout_train: NCHW

       input_name: ''

       input_shape: ''

       input_type_rt: nv12

       input_type_train: rgb

       mean_value: ''

       norm_type: data_scale

       scale_value: '0.003921568627451'

      model_parameters:

       layer_out_dump: false

       march: bayes

       onnx_model: ../../../01_common/model_zoo/mapper/detection/yolov5_onnx_optimized/yolov5s-v2.0.onnx

       output_model_file_prefix: yolov5s_640x640_nv12

       remove_node_type: Dequantize

       working_dir: model_output


      2024-06-24 15:33:41,545 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 60 input 'images' : original model shape: [1, 3, 640, 640]

      2024-06-24 15:33:41,545 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 263 The calibration_type you specified is skip, the skip uses max+random data for calibration

      2024-06-24 15:33:41,546 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 511 call build params:

       {'march': 'bayes', 'save_model': True, 'name_prefix': 'yolov5s_640x640_nv12', 'input_dict': {'images': {'input_shape': [1, 3, 640, 640], 'expected_input_type': 'YUV444_128', 'original_input_type': 'RGB', 'original_input_layout': 'NCHW', 'scales': array([0.00392157], dtype=float32)}}, 'cali_dict': {'calibration_type': 'max'}, 'hbdk_dict': {'hbdk_pass_through_params': '--O3 --cache /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json --debug --core-num 1 --fast ', 'input-source': {'images': 'pyramid', '_default_value': 'ddr'}}, 'node_dict': {}, 'check_mode': True}

      2024-06-24 15:33:41,556 file: build.py func: build line No: 32 [Mon Jun 24 15:33:41 2024] Start to Horizon NN Model Convert.

      2024-06-24 15:33:41,556 file: build.py func: build line No: 92 HorizonNN version: 0.21.2

      2024-06-24 15:33:41,556 file: build.py func: build line No: 102 HBDK version: 3.48.6

      2024-06-24 15:33:41,557 file: model_debug.py func: model_debug line No: 61 Loading horizon_nn debug methods:[]

      2024-06-24 15:33:41,557 file: hbdk_dict_parser.py func: hbdk_dict_parser line No: 36 Parsing the hbdk parameter:{'hbdk_pass_through_params': '--O3 --cache /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json --debug --core-num 1 --fast ', 'input-source': {'images': 'pyramid', '_default_value': 'ddr'}}

      2024-06-24 15:33:41,557 file: input_dict_parser.py func: input_dict_parser line No: 228 input images is from pyramid. Its layout is set to NHWC

      2024-06-24 15:33:41,557 file: build.py func: build line No: 149 The specified model compilation architecture: bayes.

      2024-06-24 15:33:41,557 file: build.py func: build line No: 151 The specified model compilation optimization parameters: [].

      2024-06-24 15:33:41,557 file: build.py func: build line No: 32 [Mon Jun 24 15:33:41 2024] Start to parse the onnx model.

      2024-06-24 15:33:41,640 file: onnx_parser.py func: onnx_parser line No: 125 Input ONNX model infomation:

      ONNX IR version:         6

      Opset version:           [11, 1]

      Producer:                pytorch2.2.2

      Domain:                  none

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

      Output name:             output0, [1, 25200, 85]

      2024-06-24 15:33:41,697 file: build.py func: build line No: 35 [Mon Jun 24 15:33:41 2024] End to parse the onnx model.

      2024-06-24 15:33:41,916 file: build.py func: build line No: 200 Saving model: yolov5s_640x640_nv12_original_float_model.onnx.

      2024-06-24 15:33:41,916 file: build.py func: build line No: 32 [Mon Jun 24 15:33:41 2024] Start to optimize the model.

      2024-06-24 15:33:42,272 file: build.py func: build line No: 35 [Mon Jun 24 15:33:42 2024] End to optimize the model.

      2024-06-24 15:33:42,309 file: build.py func: build line No: 200 Saving model: yolov5s_640x640_nv12_optimized_float_model.onnx.

      2024-06-24 15:33:42,310 file: build.py func: build line No: 32 [Mon Jun 24 15:33:42 2024] Start to calibrate the model.

      2024-06-24 15:33:42,374 file: calibration_data_set.py func: calibration_data_set line No: 89 input name: images, number_of_samples: 1

      2024-06-24 15:33:42,374 file: calibration_data_set.py func: calibration_data_set line No: 100 There are 1 samples in the calibration data set.

      2024-06-24 15:33:42,555 file: max_calibrater.py func: max_calibrater line No: 68 Run calibration model with max method.

      2024-06-24 15:33:42,697 file: calibrater.py func: calibrater line No: 205 Calibration using batch 8

      2024-06-24 15:33:43,138 file: build.py func: build line No: 35 [Mon Jun 24 15:33:43 2024] End to calibrate the model.

      2024-06-24 15:33:43,180 file: build.py func: build line No: 200 Saving model: yolov5s_640x640_nv12_calibrated_model.onnx.

      2024-06-24 15:33:43,180 file: build.py func: build line No: 32 [Mon Jun 24 15:33:43 2024] Start to quantize the model.

      2024-06-24 15:33:46,248 file: build.py func: build line No: 35 [Mon Jun 24 15:33:46 2024] End to quantize the model.

      2024-06-24 15:33:46,500 file: build.py func: build line No: 200 Saving model: yolov5s_640x640_nv12_quantized_model.onnx.

      2024-06-24 15:33:47,147 file: build.py func: build line No: 32 [Mon Jun 24 15:33:47 2024] Start to compile the model with march bayes.

      2024-06-24 15:33:47,147 file: build.py func: build line No: 35 [Mon Jun 24 15:33:47 2024] End to compile the model with march bayes.

      2024-06-24 15:33:47,437 file: hybrid_build.py func: hybrid_build line No: 134 Compile submodel: main_graph_subgraph_0

      2024-06-24 15:33:47,871 file: hbdk_cc.py func: hbdk_cc line No: 115 hbdk-cc parameters:['--O3', '--cache', '/open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json', '--debug', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'pyramid']

      2024-06-24 15:33:47,871 file: hbdk_cc.py func: hbdk_cc line No: 116 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmpb79k20zr/main_graph_subgraph_0.hbir -o /tmp/tmpb79k20zr/main_graph_subgraph_0.hbm --march bayes --progressbar --O3 --cache /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json --debug --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source pyramid

      2024-06-24 15:43:41,763 file: tool_utils.py func: tool_utils line No: 322 /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache88240.json

      2024-06-24 15:43:42,636 file: tool_utils.py func: tool_utils line No: 322 consumed time 594.739

      2024-06-24 15:43:42,744 file: tool_utils.py func: tool_utils line No: 322 FPS=225.55, latency = 4433.7 us, DDR = 21150848 bytes  (see main_graph_subgraph_0.html)

      2024-06-24 15:43:42,889 file: node_info.py func: node_info line No: 57 The converted model node information:

      ==============================================================================================================

      Node                                               ON  Subgraph Type                      In/Out DataType 

      ---------------------------------------------------------------------------------------------------------------

      HZ_PREPROCESS_FOR_images                           BPU id(0)    HzSQuantizedPreprocess    int8/int8       

      /model.0/Slice                                     BPU id(0)    Slice                     int8/int8       

      /model.0/Slice_1                                   BPU id(0)    Slice                     int8/int8       

      /model.0/Slice_2                                   BPU id(0)    Slice                     int8/int8       

      /model.0/Slice_3                                   BPU id(0)    Slice                     int8/int8       

      /model.0/Slice_4                                   BPU id(0)    Slice                     int8/int8       

      /model.0/Slice_5                                   BPU id(0)    Slice                     int8/int8       

      /model.0/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.0/conv/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.0/conv/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.1/conv/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.1/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.2/cv1/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/cv1/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.2/m/m.0/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/m/m.0/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.2/m/m.0/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/m/m.0/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.2/m/m.0/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/cv3/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/cv2/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.2/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.2/cv4/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.2/cv4/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.3/conv/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.3/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.4/cv1/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/cv1/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.4/m/m.0/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.0/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.4/m/m.0/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.0/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.4/m/m.0/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.1/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.1/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.4/m/m.1/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.1/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.4/m/m.1/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.2/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.2/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.4/m/m.2/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/m/m.2/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.4/m/m.2/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/cv3/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/cv2/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.4/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.4/cv4/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.4/cv4/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.5/conv/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.5/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.6/cv1/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/cv1/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.6/m/m.0/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.0/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.6/m/m.0/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.0/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.6/m/m.0/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.1/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.1/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.6/m/m.1/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.1/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.6/m/m.1/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.2/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.2/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.6/m/m.2/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/m/m.2/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      UNIT_CONV_FOR_/model.6/m/m.2/Add                   BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/cv3/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/cv2/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.6/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.6/cv4/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.6/cv4/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.7/conv/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.7/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.8/cv1/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.8/cv1/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.8/m.0/MaxPool                               BPU id(0)    HzQuantizedMaxPool        int8/int8       

      /model.8/m.1/MaxPool                               BPU id(0)    HzQuantizedMaxPool        int8/int8       

      /model.8/m.2/MaxPool                               BPU id(0)    HzQuantizedMaxPool        int8/int8       

      /model.8/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.8/cv2/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.8/cv2/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.9/cv1/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/cv1/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.9/m/m.0/cv1/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/m/m.0/cv1/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.9/m/m.0/cv2/conv/Conv                       BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/m/m.0/cv2/act/LeakyRelu                   BPU id(0)    HzLut                     int8/int8       

      /model.9/cv3/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/cv2/Conv                                  BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/Concat                                    BPU id(0)    Concat                    int8/int8       

      /model.9/act/LeakyRelu                             BPU id(0)    HzLut                     int8/int8       

      /model.9/cv4/conv/Conv                             BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.9/cv4/act/LeakyRelu                         BPU id(0)    HzLut                     int8/int8       

      /model.10/conv/Conv                                BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.10/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.11/Resize                                   BPU id(0)    HzQuantizedResizeUpsample int8/int8       

      /model.11/Resize_output_0_calibrated_Requantize    BPU id(0)    HzRequantize              int8/int8       

      /model.6/cv4/act/LeakyRelu_output_0_Requantize     BPU id(0)    HzRequantize              int8/int8       

      /model.12/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.13/cv1/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/cv1/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.13/m/m.0/cv1/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/m/m.0/cv1/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.13/m/m.0/cv2/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/m/m.0/cv2/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.13/cv3/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/cv2/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.13/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.13/cv4/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.13/cv4/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.14/conv/Conv                                BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.14/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.15/Resize                                   BPU id(0)    HzQuantizedResizeUpsample int8/int8       

      /model.15/Resize_output_0_calibrated_Requantize    BPU id(0)    HzRequantize              int8/int8       

      /model.4/cv4/act/LeakyRelu_output_0_Requantize     BPU id(0)    HzRequantize              int8/int8       

      /model.16/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.17/cv1/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/cv1/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.17/m/m.0/cv1/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/m/m.0/cv1/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.17/m/m.0/cv2/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/m/m.0/cv2/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.17/cv3/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/cv2/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.17/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.17/cv4/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.17/cv4/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.18/conv/Conv                                BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.18/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.19/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.20/cv1/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/cv1/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.20/m/m.0/cv1/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/m/m.0/cv1/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.20/m/m.0/cv2/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/m/m.0/cv2/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.20/cv3/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/cv2/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.20/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.20/cv4/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.20/cv4/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.21/conv/Conv                                BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.21/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.22/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.23/cv1/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/cv1/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.23/m/m.0/cv1/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/m/m.0/cv1/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.23/m/m.0/cv2/conv/Conv                      BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/m/m.0/cv2/act/LeakyRelu                  BPU id(0)    HzLut                     int8/int8       

      /model.23/cv3/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/cv2/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/Concat                                   BPU id(0)    Concat                    int8/int8       

      /model.23/act/LeakyRelu                            BPU id(0)    HzLut                     int8/int8       

      /model.23/cv4/conv/Conv                            BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.23/cv4/act/LeakyRelu                        BPU id(0)    HzLut                     int8/int8       

      /model.24/m.0/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.24/Sigmoid                                  BPU id(0)    HzLut                     int8/int8       

      ...d/model.24/Sigmoid_output_0_transpose_Reshape_0 BPU id(0)    Reshape                   int8/int8       

      ...24/Sigmoid_/model.24/Sigmoid_output_0_Transpose BPU id(0)    Transpose                 int8/int8       

      /model.24/Split                                    BPU id(0)    Split                     int8/int8       

      /model.24/Mul                                      BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Add                                      BPU id(0)    HzSElementwiseAdd         int8/int8       

      /model.24/Mul_1                                    CPU --       Mul                       float/float     

      /model.24/Mul_2                                    BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Pow                                      BPU id(0)    HzLut                     int8/int8       

      /model.24/Mul_3                                    CPU --       Mul                       float/float     

      /model.24/Concat                                   CPU --       Concat                    float/float     

      /model.24/Reshape_1                                CPU --       Reshape                   float/float     

      /model.24/m.1/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.24/Sigmoid_1                                BPU id(0)    HzLut                     int8/int8       

      ...model.24/Sigmoid_1_output_0_transpose_Reshape_0 BPU id(0)    Reshape                   int8/int8       

      ...igmoid_1_/model.24/Sigmoid_1_output_0_Transpose BPU id(0)    Transpose                 int8/int8       

      /model.24/Split_1                                  BPU id(0)    Split                     int8/int8       

      /model.24/Mul_4                                    BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Add_1                                    BPU id(0)    HzSElementwiseAdd         int8/int8       

      /model.24/Mul_5                                    CPU --       Mul                       float/float     

      /model.24/Mul_6                                    BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Pow_1                                    BPU id(0)    HzLut                     int8/int8       

      /model.24/Mul_7                                    CPU --       Mul                       float/float     

      /model.24/Concat_1                                 CPU --       Concat                    float/float     

      /model.24/Reshape_3                                CPU --       Reshape                   float/float     

      /model.24/m.2/Conv                                 BPU id(0)    HzSQuantizedConv          int8/int8       

      /model.24/Sigmoid_2                                BPU id(0)    HzLut                     int8/int8       

      ...model.24/Sigmoid_2_output_0_transpose_Reshape_0 BPU id(0)    Reshape                   int8/int8       

      ...igmoid_2_/model.24/Sigmoid_2_output_0_Transpose BPU id(0)    Transpose                 int8/int8       

      /model.24/Split_2                                  BPU id(0)    Split                     int8/int8       

      /model.24/Mul_8                                    BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Add_2                                    BPU id(0)    HzSElementwiseAdd         int8/int8       

      /model.24/Mul_9                                    CPU --       Mul                       float/float     

      /model.24/Mul_10                                   BPU id(0)    HzSElementwiseMul         int8/int8       

      /model.24/Pow_2                                    BPU id(0)    HzLut                     int8/int8       

      /model.24/Mul_11                                   CPU --       Mul                       float/float     

      /model.24/Concat_2                                 CPU --       Concat                    float/float     

      /model.24/Reshape_5                                CPU --       Reshape                   float/float     

      /model.24/Concat_3                                 CPU --       Concat                    float/float

      2024-06-24 15:43:42,891 file: build.py func: build line No: 35 [Mon Jun 24 15:43:42 2024] End to Horizon NN Model Convert.

      2024-06-24 15:43:42,993 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 593 start convert to *.bin file....

      2024-06-24 15:43:43,020 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4281 ONNX model output num : 1

      2024-06-24 15:43:43,035 file: layout_util.py func: layout_util line No: 15 set_featuremap_layout start

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4015 model_deps_info: {'hb_mapper_version': '1.21.6', 'hbdk_version': '3.48.6', 'hbdk_runtime_version': ' 3.15.40.0', 'horizon_nn_version': '0.21.2', 'onnx_model': '/open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/01_common/model_zoo/mapper/detection/yolov5_onnx_optimized/yolov5s-v2.0.onnx', 'march': 'bayes', 'layer_out_dump': False, 'log_level': 'DEBUG', 'working_dir': '/open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output', 'model_prefix': 'yolov5s_640x640_nv12', 'remove_node_type': ['Dequantize'], 'input_names': ['images'], 'input_type_rt': ['nv12'], 'input_space_and_range': ['regular'], 'input_type_train': ['rgb'], 'input_layout_rt': [''], 'input_layout_train': ['NCHW'], 'norm_type': ['data_scale'], 'scale_value': ['0.003921568627451,'], 'mean_value': [''], 'input_shape': ['1x3x640x640'], 'input_batch': [], 'cal_dir': [], 'cal_data_type': ['float32'], 'preprocess_on': False, 'calibration_type': 'skip', 'per_channel': 'False', 'hbdk_params': {'hbdk_pass_through_params': '--O3 --cache /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json --debug --core-num 1 --fast ', 'input-source': {'images': 'pyramid', '_default_value': 'ddr'}}, 'debug': True, 'compile_mode': 'latency'}

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4138 ############# model deps info #############

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4139 hb_mapper version  : 1.21.6

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4142 hbdk version       : 3.48.6

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4144 hbdk runtime version: 3.15.40.0

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4147 horizon_nn version : 0.21.2

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4151 ############# model_parameters info #############

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4157 onnx_model         : /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/01_common/model_zoo/mapper/detection/yolov5_onnx_optimized/yolov5s-v2.0.onnx

      2024-06-24 15:43:43,035 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4158 BPU march          : bayes

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4159 layer_out_dump     : False

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4160 log_level          : DEBUG

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4161 working dir        : /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4162 output_model_file_prefix: yolov5s_640x640_nv12

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4170 remove node type   : ['Dequantize']

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4183 ############# input_parameters info #############

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4201 ------------------------------------------

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4203 ---------input info : images ---------

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4204 input_name         : images

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4205 input_type_rt      : nv12

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4207 input_space&range  : regular

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4209 input_layout_rt    : None

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4210 input_type_train   : rgb

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4211 input_layout_train : NCHW

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4212 norm_type          : data_scale

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4213 input_shape        : 1x3x640x640

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4221 scale_value        : 0.003921568627451,

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4225 cal_data_type      : float32

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4226 ---------input info : images end -------

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4227 ------------------------------------------

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4229 ############# calibration_parameters info #############

      2024-06-24 15:43:43,036 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4230 preprocess_on      : False

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4231 calibration_type:  : skip

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4239 per_channel        : False

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4258 ############# compiler_parameters info #############

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4260 debug              : True

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4262 compile_mode       : latency

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4265 hbdk_pass_through_params: --O3 --cache /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/04_detection/12_yolov5s/mapper/model_output/cache.json --debug --core-num 1 --fast

      2024-06-24 15:43:43,037 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4265 input-source       : {'images': 'pyramid', '_default_value': 'ddr'}

      2024-06-24 15:43:44,181 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 774 Convert to runtime bin file successfully!

      2024-06-24 15:43:44,182 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 775 End Model Convert

      2024-06-25
      0
    • 地久天长回复地久天长:

      大部分算子都是在BPU上的,为什么会这么低的帧率


      2024-06-25
      0
    • kotei左文亮回复地久天长:

      后面CPU算子和BPU算子存在大量交叉计算,相互传输数据会导致时延,帧率降低;可以尝试调整网络或者算子,让尽可能多的算子在BPU上进行计算。

      2024-06-25
      0
    • 地久天长回复kotei左文亮:

      感谢回复,我们用的是yolov5公版的pt文件,我测试过oe包里面提供的yolov5s的onnx模型文件帧率比较高,我想知道地平线提供的yolov5的模型源码能不能提供一下,我们用地平线修改过的yolov5源码重新训练我们的模型,我们对yolov5不是很熟悉,希望基于地平线的版本进行修改。

      2024-06-25
      0
    • kotei左文亮回复地久天长:

      这个源码不是很方便提供,不好意思啊。可以按照OE包文档推荐的高效模型搭建方法,去对应的修改网络结构。

      2024-06-26
      0
  • kotei左文亮
    Lv.3

    有没有转bin文件的log?

    2024-06-24
    0
    0