The hb_model_info Tool

The hb_model_info tool is used to parse the dependencies and parameters of the *.hbm, the *.bc in compilation and the basic information of the *.onnx model, at the same time support the checking of *.bc deletable nodes, and you can view the model structure by starting the webserver.

hb_mpdel_info_tool

Support Range

It supports viewing the basic information of *.onnx models, the dependencies and parameters information of *.bc model, the information of deletable nodes, as well as the dependencies and parameters information of *.hbm model.

Usage

Usage: hb_model_info [OPTIONS] MODEL_PATH

  A tool to get info about model compilation parameters, properties

Options:
  -h, --help       Show this message and exit.
  --version        Show the version and exit.
  -v, --visualize  Start netron server to show model structure

Parameters Introduction

Parameter NameParameter Description
-h, --helpDisplay help information and exit.
--versionDisplay version information and exit.
-v, --visualizeStart netron server to view the model structure, you can close it with Ctrl+C when you finish viewing.

Usage Example

Taking the resnet50_224x224_nv12.hbm model as an example, you can refer to the following command to view the model compilation information:

hb_model_info ./model_output/resnet50_224x224_nv12.hbm

Output Contents

The output includes some input information during model compilation, as well as memory usage information occupied when the model is deployed and run on the board, as shown below:

Note

The version number information and other content in the following code block will change with the release package version, and here is only as an example.

log will be stored in /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/03_classification/03_resnet50/hb_model_info.log
Start hb_model_info....
hb_model_info version 3.4.3
hbm_path: /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/03_classification/03_resnet50/model_output/resnet50_224x224_nv12.hbm
pid:94252 tid:94252 hbrt4_log/src/logger.rs:402: Logger of HBRT4 initialized, version = 4.4.3
pid:94252 tid:94252 hbrt4_loader/src/parsing.rs:91: Load hbm from file; filename="resnet50_224x224_nv12.hbm"
pid:94361 tid:94361 hbrt4_log/src/logger.rs:402: Logger of HBRT4 initialized, version = 4.4.3
pid:94361 tid:94361 hbrt4_loader/src/parsing.rs:42: Load hbm header from file; filename="resnet50_224x224_nv12.hbm"
pid:94361 tid:94361 hbrt4_log/src/logger.rs:402: Logger of HBRT4 initialized, version = 4.4.3
pid:94361 tid:94361 hbrt4_loader/src/parsing.rs:91: Load hbm from file; filename="resnet50_224x224_nv12.hbm"
  FPS=1145.9400000000001, latency = 872.60000000000002 us, DDR = 26316800 bytes, Compiling HBDK version = "4.4.3"   (see .hb_model_info/resnet50_224x224_nv12.html)
HBDK hbm perf SUCCESS
************* resnet50_224x224_nv12 *************
############# model deps info #############
builder version     : 3.4.3
hbdk version        : 4.4.3
hmct version        : 2.0.5
############# model_parameters info #############
onnx_model          : /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/01_common/model_zoo/mapper/classification/resnet50/resnet50.onnx
BPU march           : nash-e
layer_out_dump      : False
working dir         : /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/03_classification/03_resnet50/model_output
output_model_file_prefix: resnet50_224x224_nv12
node_info           : {}
############# input_parameters info #############
------------------------------------------
---------input info : input  ---------
input_name          : input 
input_type_rt       : nv12
input_space&range   : regular
input_type_train    : rgb
input_layout_train  : NCHW
norm_type           : data_mean_and_scale
input_shape         : 1x3x224x224
mean_value          : [123.675, 116.28, 103.53]
scale_value         : [0.01712475, 0.017507, 0.01742919]
std_value           : []
separate_batch      : False
---------input info : input end -------
------------------------------------------
############# calibration_parameters info #############
calibration_type    : default
max_percentile      : None
per_channel         : False
cal_data_dir        : /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/03_classification/03_resnet50/calibration_data_rgb
############# compiler_parameters info #############
debug               : True
optimize_level      : O2
compile_mode        : latency
core_num            : 1
balance_factor      : 100
input_source        : {'input': 'pyramid'}
cache_mode          : disable
############# memory info #############
input memory        : 75264
output memory       : 4096
static memory       : 26478248
dynamic memory      : 79360
intermediate memory : 0
temporary memory    : 0
min memory requirement: 26557608
hbm_path: /open_explorer/samples/ai_toolchain/horizon_model_convert_sample/03_classification/03_resnet50/model_output/resnet50_224x224_nv12.hbm
pid:94252 tid:94252 hbrt4_loader/src/parsing.rs:42: Load hbm header from file; filename="resnet50_224x224_nv12.hbm"
pid:94252 tid:94252 hbrt4_log/src/logger.rs:402: Logger of HBRT4 initialized, version = 4.4.3
pid:94252 tid:94252 hbrt4_loader/src/parsing.rs:91: Load hbm from file; filename="resnet50_224x224_nv12.hbm"
############# Model input/output info #############
NAME   TYPE   SHAPE            DATA_TYPE
------ ------ ---------------- ---------
input_y  input  [1, 224, 224, 1] UINT8
input_uv input  [1, 112, 112, 2] UINT8
output   output [1, 1000]        FLOAT32