在使用转换工具链的时候遇到了模型无法转成为resizer模型的情况,转换log如下
[root@cfb8ae34a3bc mapper]# bash 03_build.sh
cd $(dirname $0)
config_file="./ocr_config.yaml"
model_type="onnx"
# build model
hb_mapper makertbin --config ${config_file} \
--model-type ${model_type}
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography.hazmat.backends import default_backend
2023-02-15 11:20:54,282 INFO log will be stored in /horizon_model_convert_sample/08_opendrive/03_lprnet/mapper/hb_mapper_makertbin.log
2023-02-15 11:20:54,282 INFO Start hb_mapper....
2023-02-15 11:20:54,282 INFO hbdk version 3.42.1
2023-02-15 11:20:54,282 INFO horizon_nn version 0.15.7
2023-02-15 11:20:54,282 INFO hb_mapper version 1.13.3
2023-02-15 11:20:54,283 INFO Start Model Convert....
2023-02-15 11:20:54,293 INFO Using onnx model file: /horizon_model_convert_sample/08_opendrive/onnx_model/lprnet_20230131_1x3x32x96_sim.onnx
2023-02-15 11:20:54,297 INFO Model has 1 inputs according to model file
2023-02-15 11:20:54,298 INFO Model name not given in yaml_file, using model name from model file: ['input']
2023-02-15 11:20:54,298 INFO Model input shape not given in yaml_file, using shape from model file: [[1, 3, 32, 96]]
2023-02-15 11:20:54,298 INFO nv12 input type rt received.
2023-02-15 11:20:54,298 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
2023-02-15 11:20:54,298 INFO custom_op does not exist, skipped
2023-02-15 11:20:54,301 INFO *******************************************
2023-02-15 11:20:54,301 INFO First calibration picture name: 0.bin
2023-02-15 11:20:54,301 INFO First calibration picture md5:
9e58c897c8781fbf98aac67ec65f0226 /horizon_model_convert_sample/08_opendrive/03_lprnet/mapper/quant_data/0.bin
2023-02-15 11:20:54,304 INFO *******************************************
2023-02-15 11:20:54,410 INFO [Wed Feb 15 11:20:54 2023] Start to Horizon NN Model Convert.
2023-02-15 11:20:54,410 INFO Parsing the input parameter:{'input': {'input_shape': [1, 3, 32, 96], 'input_batch': 8, 'expected_input_type': 'YUV444_128', 'original_input_type': 'BGR', 'original_input_layout': 'NCHW', 'scales': array([0.00390625], dtype=float32)}}
2023-02-15 11:20:54,410 INFO Parsing the calibration parameter
2023-02-15 11:20:54,410 INFO Parsing the hbdk parameter:{'hbdk_pass_through_params': '--O0 --core-num 1 --fast ', 'input-source': {'input': 'resizer', '_default_value': 'ddr'}}
2023-02-15 11:20:54,410 INFO HorizonNN version: 0.15.7
2023-02-15 11:20:54,410 INFO HBDK version: 3.42.1
2023-02-15 11:20:54,410 INFO [Wed Feb 15 11:20:54 2023] Start to parse the onnx model.
2023-02-15 11:20:54,415 INFO Input ONNX model infomation:
ONNX IR version: 5
Opset version: [10]
Producer: pytorch1.12.1
Domain: none
Input name: input, [1, 3, 32, 96]
Output name: output, [1, 70, 1, 22]
2023-02-15 11:20:54,438 INFO [Wed Feb 15 11:20:54 2023] End to parse the onnx model.
2023-02-15 11:20:54,438 INFO Model input names parsed from model: ['input']
2023-02-15 11:20:54,439 INFO Create a preprocessing operator for input_name input with means=None, std=[256.], original_input_layout=NCHW, color convert from 'BGR' to 'YUV_BT601_FULL_RANGE'.
2023-02-15 11:20:54,460 INFO Saving the original float model: lprnet_20230209_1x3x32x96_sim_original_float_model.onnx.
2023-02-15 11:20:54,460 INFO [Wed Feb 15 11:20:54 2023] Start to optimize the model.
2023-02-15 11:20:54,619 INFO [Wed Feb 15 11:20:54 2023] End to optimize the model.
2023-02-15 11:20:54,624 INFO Saving the optimized model: lprnet_20230209_1x3x32x96_sim_optimized_float_model.onnx.
2023-02-15 11:20:54,624 INFO [Wed Feb 15 11:20:54 2023] Start to calibrate the model.
2023-02-15 11:20:54,624 INFO There are 100 samples in the calibration data set.
2023-02-15 11:20:54,657 INFO Run calibration model with default calibration method.
Default calibration in progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:03<00:00, 3.82it/s]
2023-02-15 11:20:58,519 WARNING got unexpected output threshold on conv Conv_2! value: 7.66673e-40
2023-02-15 11:20:58,519 WARNING got unexpected input threshold on conv Conv_3! value: 7.66673e-40
2023-02-15 11:20:58,520 WARNING got unexpected output threshold on conv Conv_3! value: 3.1909e-41
2023-02-15 11:20:58,520 WARNING got unexpected input threshold on conv Conv_5! value: 3.1909e-41
2023-02-15 11:20:58,520 WARNING got unexpected output threshold on conv Conv_5! value: 3.45056e-41
2023-02-15 11:20:58,520 WARNING got unexpected input threshold on conv Conv_7! value: 3.45056e-41
2023-02-15 11:20:58,520 WARNING got unexpected output threshold on conv Conv_7! value: 3.50255e-41
2023-02-15 11:20:58,520 WARNING got unexpected input threshold on conv Conv_9! value: 3.50255e-41
2023-02-15 11:20:58,520 WARNING got unexpected output threshold on conv Conv_9! value: 3.39689e-41
2023-02-15 11:20:58,520 WARNING got unexpected input threshold on conv Conv_11! value: 3.39689e-41
2023-02-15 11:20:58,521 WARNING got unexpected output threshold on conv Conv_11! value: 3.49904e-41
2023-02-15 11:20:58,521 WARNING got unexpected input threshold on conv Conv_12! value: 3.49904e-41
2023-02-15 11:20:58,521 WARNING got unexpected output threshold on conv Conv_12! value: 3.48937e-41
2023-02-15 11:20:58,521 WARNING got unexpected input threshold on conv Conv_14! value: 3.48937e-41
2023-02-15 11:20:58,521 WARNING got unexpected output threshold on conv Conv_14! value: 3.14087e-41
2023-02-15 11:20:58,521 WARNING got unexpected input threshold on conv Conv_16! value: 3.14087e-41
2023-02-15 11:20:58,521 WARNING got unexpected output threshold on conv Conv_16! value: 0
2023-02-15 11:20:58,521 WARNING got unexpected input threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,522 WARNING got unexpected output threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,522 WARNING got unexpected input threshold on conv Conv_20! value: 0
2023-02-15 11:20:58,522 WARNING got unexpected output threshold on conv Conv_20! value: 3.47228e-41
2023-02-15 11:20:58,522 WARNING got unexpected input threshold on conv Conv_22! value: 3.47228e-41
2023-02-15 11:20:58,522 WARNING got unexpected output threshold on conv Conv_22! value: 3.48979e-41
2023-02-15 11:20:58,522 WARNING got unexpected input threshold on conv Conv_24! value: 3.48979e-41
2023-02-15 11:20:58,522 WARNING got unexpected output threshold on conv Conv_24! value: 3.50255e-41
2023-02-15 11:20:58,522 WARNING got unexpected input threshold on conv Conv_26! value: 3.50255e-41
2023-02-15 11:20:58,523 WARNING got unexpected output threshold on conv Conv_26! value: 3.50142e-41
2023-02-15 11:20:58,523 WARNING got unexpected input threshold on conv Conv_28! value: 3.50142e-41
2023-02-15 11:20:58,523 WARNING got unexpected input threshold on conv Conv_33! value: 3.39689e-41
2023-02-15 11:20:58,523 WARNING got unexpected input threshold on conv UNIT_CONV_FOR_input.88_0.16616_TO_FUSE_SCALE! value: 0
2023-02-15 11:20:58,746 WARNING got unexpected output threshold on conv Conv_2! value: 6.07227e-40
2023-02-15 11:20:58,746 WARNING got unexpected input threshold on conv Conv_3! value: 6.07227e-40
2023-02-15 11:20:58,746 WARNING got unexpected output threshold on conv Conv_3! value: 3.1909e-41
2023-02-15 11:20:58,746 WARNING got unexpected input threshold on conv Conv_5! value: 3.1909e-41
2023-02-15 11:20:58,746 WARNING got unexpected output threshold on conv Conv_5! value: 3.45056e-41
2023-02-15 11:20:58,747 WARNING got unexpected input threshold on conv Conv_7! value: 3.45056e-41
2023-02-15 11:20:58,747 WARNING got unexpected output threshold on conv Conv_7! value: 3.50255e-41
2023-02-15 11:20:58,747 WARNING got unexpected input threshold on conv Conv_9! value: 3.50255e-41
2023-02-15 11:20:58,747 WARNING got unexpected output threshold on conv Conv_9! value: 3.39689e-41
2023-02-15 11:20:58,747 WARNING got unexpected input threshold on conv Conv_11! value: 3.39689e-41
2023-02-15 11:20:58,747 WARNING got unexpected output threshold on conv Conv_11! value: 3.49904e-41
2023-02-15 11:20:58,747 WARNING got unexpected input threshold on conv Conv_12! value: 3.49904e-41
2023-02-15 11:20:58,747 WARNING got unexpected output threshold on conv Conv_12! value: 3.48937e-41
2023-02-15 11:20:58,748 WARNING got unexpected input threshold on conv Conv_14! value: 3.48937e-41
2023-02-15 11:20:58,748 WARNING got unexpected output threshold on conv Conv_14! value: 3.14087e-41
2023-02-15 11:20:58,748 WARNING got unexpected input threshold on conv Conv_16! value: 3.14087e-41
2023-02-15 11:20:58,748 WARNING got unexpected output threshold on conv Conv_16! value: 0
2023-02-15 11:20:58,748 WARNING got unexpected input threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,748 WARNING got unexpected output threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,748 WARNING got unexpected input threshold on conv Conv_20! value: 0
2023-02-15 11:20:58,748 WARNING got unexpected output threshold on conv Conv_20! value: 3.47228e-41
2023-02-15 11:20:58,749 WARNING got unexpected input threshold on conv Conv_22! value: 3.47228e-41
2023-02-15 11:20:58,749 WARNING got unexpected output threshold on conv Conv_22! value: 3.48979e-41
2023-02-15 11:20:58,749 WARNING got unexpected input threshold on conv Conv_24! value: 3.48979e-41
2023-02-15 11:20:58,749 WARNING got unexpected output threshold on conv Conv_24! value: 3.50255e-41
2023-02-15 11:20:58,749 WARNING got unexpected input threshold on conv Conv_26! value: 3.50255e-41
2023-02-15 11:20:58,749 WARNING got unexpected output threshold on conv Conv_26! value: 3.50142e-41
2023-02-15 11:20:58,749 WARNING got unexpected input threshold on conv Conv_28! value: 3.50142e-41
2023-02-15 11:20:58,749 WARNING got unexpected input threshold on conv Conv_33! value: 3.39689e-41
2023-02-15 11:20:58,750 WARNING got unexpected input threshold on conv UNIT_CONV_FOR_input.88_0.11847_TO_FUSE_SCALE! value: 0
2023-02-15 11:20:58,966 WARNING got unexpected output threshold on conv Conv_2! value: 7.45457e-40
2023-02-15 11:20:58,966 WARNING got unexpected input threshold on conv Conv_3! value: 7.45457e-40
2023-02-15 11:20:58,966 WARNING got unexpected output threshold on conv Conv_3! value: 2.26436e-41
2023-02-15 11:20:58,966 WARNING got unexpected input threshold on conv Conv_5! value: 2.26436e-41
2023-02-15 11:20:58,966 WARNING got unexpected output threshold on conv Conv_5! value: 3.40179e-41
2023-02-15 11:20:58,966 WARNING got unexpected input threshold on conv Conv_7! value: 3.40179e-41
2023-02-15 11:20:58,967 WARNING got unexpected output threshold on conv Conv_7! value: 3.11929e-41
2023-02-15 11:20:58,967 WARNING got unexpected input threshold on conv Conv_9! value: 3.11929e-41
2023-02-15 11:20:58,967 WARNING got unexpected output threshold on conv Conv_9! value: 3.38834e-41
2023-02-15 11:20:58,967 WARNING got unexpected input threshold on conv Conv_11! value: 3.38834e-41
2023-02-15 11:20:58,967 WARNING got unexpected output threshold on conv Conv_11! value: 3.41524e-41
2023-02-15 11:20:58,967 WARNING got unexpected input threshold on conv Conv_12! value: 3.41524e-41
2023-02-15 11:20:58,967 WARNING got unexpected output threshold on conv Conv_12! value: 3.13947e-41
2023-02-15 11:20:58,967 WARNING got unexpected input threshold on conv Conv_14! value: 3.13947e-41
2023-02-15 11:20:58,968 WARNING got unexpected output threshold on conv Conv_14! value: 3.13064e-41
2023-02-15 11:20:58,968 WARNING got unexpected input threshold on conv Conv_16! value: 3.13064e-41
2023-02-15 11:20:58,968 WARNING got unexpected output threshold on conv Conv_16! value: 0
2023-02-15 11:20:58,968 WARNING got unexpected input threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,968 WARNING got unexpected output threshold on conv Conv_18! value: 0
2023-02-15 11:20:58,968 WARNING got unexpected input threshold on conv Conv_20! value: 0
2023-02-15 11:20:58,968 WARNING got unexpected output threshold on conv Conv_20! value: 3.3917e-41
2023-02-15 11:20:58,968 WARNING got unexpected input threshold on conv Conv_22! value: 3.3917e-41
2023-02-15 11:20:58,969 WARNING got unexpected output threshold on conv Conv_22! value: 3.09911e-41
2023-02-15 11:20:58,969 WARNING got unexpected input threshold on conv Conv_24! value: 3.09911e-41
2023-02-15 11:20:58,969 WARNING got unexpected output threshold on conv Conv_24! value: 3.40516e-41
2023-02-15 11:20:58,969 WARNING got unexpected input threshold on conv Conv_26! value: 3.40516e-41
2023-02-15 11:20:58,969 WARNING got unexpected output threshold on conv Conv_26! value: 3.4287e-41
2023-02-15 11:20:58,969 WARNING got unexpected input threshold on conv Conv_28! value: 3.4287e-41
2023-02-15 11:20:58,969 WARNING got unexpected input threshold on conv Conv_33! value: 3.38834e-41
2023-02-15 11:20:58,969 WARNING got unexpected input threshold on conv UNIT_CONV_FOR_input.88_0.15841_TO_FUSE_SCALE! value: 0
2023-02-15 11:20:59,006 INFO Select max method.
2023-02-15 11:20:59,008 WARNING find illegal threshold in input.76, it will be set default.
2023-02-15 11:20:59,008 WARNING find illegal threshold in input.88, it will be set default.
2023-02-15 11:20:59,042 INFO [Wed Feb 15 11:20:59 2023] End to calibrate the model.
2023-02-15 11:20:59,043 INFO [Wed Feb 15 11:20:59 2023] Start to quantize the model.
2023-02-15 11:20:59,217 WARNING got unexpected output threshold on conv Conv_2! value: 7.66673e-40
2023-02-15 11:20:59,217 WARNING got unexpected input threshold on conv Conv_3! value: 7.66673e-40
2023-02-15 11:20:59,218 WARNING got unexpected output threshold on conv Conv_3! value: 3.1909e-41
2023-02-15 11:20:59,218 WARNING got unexpected input threshold on conv Conv_5! value: 3.1909e-41
2023-02-15 11:20:59,218 WARNING got unexpected output threshold on conv Conv_5! value: 3.45056e-41
2023-02-15 11:20:59,218 WARNING got unexpected input threshold on conv Conv_7! value: 3.45056e-41
2023-02-15 11:20:59,218 WARNING got unexpected output threshold on conv Conv_7! value: 3.50255e-41
2023-02-15 11:20:59,218 WARNING got unexpected input threshold on conv Conv_9! value: 3.50255e-41
2023-02-15 11:20:59,218 WARNING got unexpected output threshold on conv Conv_9! value: 3.39689e-41
2023-02-15 11:20:59,218 WARNING got unexpected input threshold on conv Conv_11! value: 3.39689e-41
2023-02-15 11:20:59,219 WARNING got unexpected output threshold on conv Conv_11! value: 3.49904e-41
2023-02-15 11:20:59,219 WARNING got unexpected input threshold on conv Conv_12! value: 3.49904e-41
2023-02-15 11:20:59,219 WARNING got unexpected output threshold on conv Conv_12! value: 3.48937e-41
2023-02-15 11:20:59,219 WARNING got unexpected input threshold on conv Conv_14! value: 3.48937e-41
2023-02-15 11:20:59,219 WARNING got unexpected output threshold on conv Conv_14! value: 3.14087e-41
2023-02-15 11:20:59,219 WARNING got unexpected input threshold on conv Conv_16! value: 3.14087e-41
2023-02-15 11:20:59,219 WARNING got unexpected output threshold on conv Conv_20! value: 3.47228e-41
2023-02-15 11:20:59,220 WARNING got unexpected input threshold on conv Conv_22! value: 3.47228e-41
2023-02-15 11:20:59,220 WARNING got unexpected output threshold on conv Conv_22! value: 3.48979e-41
2023-02-15 11:20:59,220 WARNING got unexpected input threshold on conv Conv_24! value: 3.48979e-41
2023-02-15 11:20:59,220 WARNING got unexpected output threshold on conv Conv_24! value: 3.50255e-41
2023-02-15 11:20:59,220 WARNING got unexpected input threshold on conv Conv_26! value: 3.50255e-41
2023-02-15 11:20:59,220 WARNING got unexpected output threshold on conv Conv_26! value: 3.50142e-41
2023-02-15 11:20:59,220 WARNING got unexpected input threshold on conv Conv_28! value: 3.50142e-41
2023-02-15 11:20:59,220 WARNING got unexpected input threshold on conv Conv_33! value: 3.39689e-41
2023-02-15 11:20:59,361 INFO input input is from resizer. Its layout is set to NHWC
2023-02-15 11:20:59,458 INFO [Wed Feb 15 11:20:59 2023] End to quantize the model.
2023-02-15 11:20:59,493 INFO Saving the quantized model: lprnet_20230209_1x3x32x96_sim_quantized_model.onnx.
2023-02-15 11:20:59,694 INFO [Wed Feb 15 11:20:59 2023] Start to compile the model with march bernoulli2.
2023-02-15 11:20:59,743 INFO Compile submodel: torch_jit_subgraph_0
2023-02-15 11:20:59,799 INFO hbdk-cc parameters:['--O0', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NCHW', '--input-source', 'resizer']
2023-02-15 11:21:00,203 INFO [Wed Feb 15 11:21:00 2023] End to compile the model with march bernoulli2.
Unsupported input source: 1
2023-02-15 11:21:00,642 INFO core[0] open!
2023-02-15 11:21:00,642 ERROR there is no enough memory for hbm infer, the model is too huge.
模型和量化数据在百度网盘
链接:https://pan.baidu.com/s/1LiwuGPtCGIU5ukxsKSZ2JQ
提取码:2wlq
供参考
