您好,我的模型转换的参数 input_type_rt: nv12,input_type_train: bgrp,在自己写推理代码时,是将输入图像转换成nv12格式吗,还是有其他什么特殊处理吗。我现在手动将BGR转换成NV12格式后,推理结果和转换前模型结果相差较大。
1.用的什么算法?
2.量化时,可选参数进行调整,https://developer.horizon.ai/forumDetail/136488103547258551-
3.方便的话,贴一下图像转化的代码?
1. 用的是一个普通的三分类MobileNetV2模型;
2. yaml文件的参数配置:
calibration_parameters:
cal_data_dir: ./train
calibration_type: kl
preprocess_on: true
promoter_level: -1
compiler_parameters:
compile_mode: latency
debug: false
optimize_level: O2
input_parameters:
input_name: data
input_shape: 1x3x224x224
input_type_rt: nv12
input_type_train: bgrp
mean_file: model_zoo/meanfile.txt
norm_type: mean_file_and_scale
scale_value: 0.017
model_parameters:
caffe_model: model_zoo/mobilenetv2-normal.caffemodel
layer_out_dump: false
log_level: debug
onnx_model: None
output_layer: NCHW
output_model_file_prefix: mobilenetv2-normal
prototxt: model_zoo/mobilenetv2-normal_horizon.prototxt
working_dir: model_output
train文件夹下存放的是100张jpg的图像。
3. 我们将转换后的图像验证过了,应该没有格式问题,格式为NV12。