专栏算法工具链模型转换报错

模型转换报错

已解决
Darth Nihilus2026-05-15
243
12

yolov5n.yaml文件如下:

model_parameters:

onnx_model: '/data/horizon_j5/data/yolov5n.onnx'

march: "bayes"

layer_out_dump: False

working_dir: '../model_output'

output_model_file_prefix: 'yolov5n-det'

remove_node_type: "Dequantize"

node_info: {"/model.10/m/m.0/attn/Softmax": {'ON': 'BPU','InputType': 'int8','OutputType': 'int8'}}

input_parameters:

input_name: 'images'

input_shape: '1x3x640x640'

input_type_rt: 'nv12'

input_type_train: 'rgb'

input_layout_train: 'NCHW'

mean_value: '0.0 0.0 0.0'

scale_value: '0.00392157 0.00392157 0.00392157'

calibration_parameters:

cal_dir: '/data/horizon_j5/data/calib_data'

compiler_parameters:

compile_mode: 'latency'

core_num: 1

optimize_level: 'O2'

jobs: 8

运行与报错如下:

hb_mapper makertbin --config /data/horizon_j5/data/yolov5n.yaml --model-type onnx

/usr/local/lib/python3.8/dist-packages/paramiko/pkey.py:100: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.

"cipher": algorithms.TripleDES,

/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:259: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.

"class": algorithms.TripleDES,

2026-05-15 09:49:15,773 INFO log will be stored in //hb_mapper_makertbin.log

2026-05-15 09:49:15,774 INFO Start hb_mapper....

2026-05-15 09:49:15,774 INFO hbdk version 3.49.13

2026-05-15 09:49:15,774 INFO horizon_nn version 1.0.9

2026-05-15 09:49:15,774 INFO hb_mapper version 1.24.1

2026-05-15 09:49:15,774 INFO Start Model Convert....

2026-05-15 09:49:15,784 INFO Using onnx model file: /data/horizon_j5/data/yolov5n.onnx

2026-05-15 09:49:15,804 INFO Model has 1 inputs according to model file

2026-05-15 09:49:15,805 INFO nv12 input type rt received.

2026-05-15 09:49:15,806 ERROR Parse 'calibration_parameters' failed!

2026-05-15 09:49:15,806 ERROR yaml file parse failed. Please double check your config file inputs

2026-05-15 09:49:15,808 ERROR Wrong cal_dir num given, cal_dir num 0 is not equal to input num 1

算法工具链
社区活动征程5
评论2
0/600
  • DR_KAN
    Lv.5
    你的/data/horizon_j5/data/calib_data下面直接放校准数据就行,比如npy或者bin文件
    2026-05-15
    0
    3
    • Darth Nihilus回复DR_KAN:

      我重新修改了地址,dir对了但是报错是:

      2026-05-17 16:06:39,944 WARNING The calibration dir name suffix is not the same as the value float32 of the parameter cal_data_type, the parameter setting will prevail

      2026-05-17 16:06:39,945 INFO custom_op does not exist, skipped

      2026-05-17 16:06:39,945 WARNING Input node images's input_source not set, it will be set to pyramid by default

      2026-05-17 16:06:39,948 INFO *******************************************

      2026-05-17 16:06:39,948 INFO First calibration picture name: test.npy

      2026-05-17 16:06:39,949 INFO First calibration picture md5:

      d7193da8cb6f902d097599c5a6bc67da /data/horizon_j5/data/calib_data/test.npy

      2026-05-17 16:06:39,965 INFO *******************************************

      2026-05-17 16:06:39,968 ERROR load cal data for input 'images' error

      2026-05-17 16:06:39,970 ERROR cannot reshape array of size 1228832 into shape (1,3,640,640)

      2026-05-17
      0
    • DR_KAN回复Darth Nihilus:

      你这个npy有head数据,不纯净,建议转成bin再做校准吧,或者把head数据删了。已经快成功了。

      2026-05-18
      0
    • Darth Nihilus回复DR_KAN:

      老师,我这边将.bin拷贝至板中,根据教程:

      ping 192.168.0.10

      PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.

      64 bytes from 192.168.0.10: icmp_seq=1 ttl=63 time=0.308 ms

      64 bytes from 192.168.0.10: icmp_seq=2 ttl=63 time=0.415 ms

      64 bytes from 192.168.0.10: icmp_seq=3 ttl=63 time=0.315 ms

      64 bytes from 192.168.0.10: icmp_seq=4 ttl=63 time=0.323 ms

      --- 192.168.0.10 ping statistics ---

      4 packets transmitted, 4 received, 0% packet loss, time 3072ms

      rtt min/avg/max/mdev = 0.308/0.340/0.415/0.043 ms

      scp model_output/yolov5n-det.bin root@192.168.0.10:/userdata

      ssh: connect to host 192.168.0.10 port 22: Connection refused

      lost connection

      这个如何解决呢?

      2026-05-19
      0
  • YCJ
    Lv.4
    这是没有检测到校准集,你的cal_data_dir参数写错了吧
    2026-05-15
    0
    7
    • Darth Nihilus回复YCJ:

      我重新修改了地址,dir对了但是报错是:

      2026-05-17 16:06:39,944 WARNING The calibration dir name suffix is not the same as the value float32 of the parameter cal_data_type, the parameter setting will prevail

      2026-05-17 16:06:39,945 INFO custom_op does not exist, skipped

      2026-05-17 16:06:39,945 WARNING Input node images's input_source not set, it will be set to pyramid by default

      2026-05-17 16:06:39,948 INFO *******************************************

      2026-05-17 16:06:39,948 INFO First calibration picture name: test.npy

      2026-05-17 16:06:39,949 INFO First calibration picture md5:

      d7193da8cb6f902d097599c5a6bc67da /data/horizon_j5/data/calib_data/test.npy

      2026-05-17 16:06:39,965 INFO *******************************************

      2026-05-17 16:06:39,968 ERROR load cal data for input 'images' error

      2026-05-17 16:06:39,970 ERROR cannot reshape array of size 1228832 into shape (1,3,640,640)

      2026-05-17
      0
    • YCJ回复Darth Nihilus:

      校准集的处理有问题,你的输入是1*3*640*640=1228800,现在你的npy文件多了32个元素,检查一下校准集的处理是否正确,要与模型前处理一致

      2026-05-18
      0
    • Darth Nihilus回复YCJ:

      老师,我这边将.bin拷贝至板中,根据教程:

      ping 192.168.0.10

      PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.

      64 bytes from 192.168.0.10: icmp_seq=1 ttl=63 time=0.308 ms

      64 bytes from 192.168.0.10: icmp_seq=2 ttl=63 time=0.415 ms

      64 bytes from 192.168.0.10: icmp_seq=3 ttl=63 time=0.315 ms

      64 bytes from 192.168.0.10: icmp_seq=4 ttl=63 time=0.323 ms

      --- 192.168.0.10 ping statistics ---

      4 packets transmitted, 4 received, 0% packet loss, time 3072ms

      rtt min/avg/max/mdev = 0.308/0.340/0.415/0.043 ms

      scp model_output/yolov5n-det.bin root@192.168.0.10:/userdata

      ssh: connect to host 192.168.0.10 port 22: Connection refused

      lost connection

      这个如何解决呢?

      2026-05-19
      0
    • YCJ回复Darth Nihilus:

      检查一下板端有没有ssh服务,是否启动

      2026-05-19
      0
    • Darth Nihilus回复YCJ:

      这个如何检查啊?我看说是在开发机上ddk目录下,但是我docker环境中没有找到这个目录,想请教下~

      2026-05-19
      0
    • YCJ回复Darth Nihilus:

      你ssh能连板子吗?不能连的话在板子上装ssh服务呀,这个跟docker没有关系

      2026-05-19
      0
    • Darth Nihilus回复YCJ:

      我就是不知道怎么在板子上安ssh。我看教程说是在开发机上运行.sh脚本远程安装

      2026-05-19
      0