diff --git a/mindspore/lite/test/config/models_for_process_only.cfg b/mindspore/lite/test/config/models_for_process_only.cfg index b707f0d3543..488a0ed8168 100644 --- a/mindspore/lite/test/config/models_for_process_only.cfg +++ b/mindspore/lite/test/config/models_for_process_only.cfg @@ -27,8 +27,6 @@ ml_video_edit_art_transfer.onnx;3 #ml_table_detection.onnx: onnx quantized model ml_table_detection.onnx intent_detect_hi_v2.tflite -# cur acc for hiai_nlu_model_v1 is 0.6% -hiai_nlu_model_v1.pb;3;1,32:1,32:1,32 raise_watch.tflite ml_pic_shopping.pb hdc_orc_recog_202106.onnx diff --git a/mindspore/lite/test/config/models_with_multiple_inputs.cfg b/mindspore/lite/test/config/models_with_multiple_inputs.cfg index db7b9fa0e0f..bab862145db 100644 --- a/mindspore/lite/test/config/models_with_multiple_inputs.cfg +++ b/mindspore/lite/test/config/models_with_multiple_inputs.cfg @@ -48,3 +48,4 @@ hiai_nlu_onnx_model_v1_1.onnx;3 ml_video_edit_art_transfer_20210513.onnx;3 ml_asr_decoder_202103.onnx;2;1,64,512:1,64 ml_audio_kit_encoder_v5.pb;6;1,32:1,32:1,32:1,32:1:1 +hiai_nlu_model_v1.pb;3;1,16:1,16:1,16 2.0 diff --git a/mindspore/lite/test/config/models_with_multiple_inputs_fp16.cfg b/mindspore/lite/test/config/models_with_multiple_inputs_fp16.cfg index 38d69fef400..dd84c012075 100644 --- a/mindspore/lite/test/config/models_with_multiple_inputs_fp16.cfg +++ b/mindspore/lite/test/config/models_with_multiple_inputs_fp16.cfg @@ -33,3 +33,4 @@ hiai_transformer_encoder.pb;15 4 decoder_step_nocumsum_v5.pb;13;1:1,512:1,1429,2:1,127:1,127:1,127:1,127,320:1,80:1,512:1,512:1,512:1,512:1,512 0.5 ml_video_edit_art_transfer_20210513.onnx;3 1 ml_asr_decoder_202103.onnx;2;1,64,512:1,64 0.5 +hiai_nlu_model_v1.pb;3;1,16:1,16:1,16 2.0 diff --git a/mindspore/lite/tools/anf_exporter/anf_exporter.cc b/mindspore/lite/tools/anf_exporter/anf_exporter.cc index 641d10ce26e..38ad4134e72 100644 --- a/mindspore/lite/tools/anf_exporter/anf_exporter.cc +++ b/mindspore/lite/tools/anf_exporter/anf_exporter.cc @@ -155,7 +155,7 @@ int AnfExporter::ConvertQuantParam(const std::unique_ptr &me // convert input quant param for (size_t i = 0; i < dst_node->inputIndex.size(); i++) { if (i >= input_quant_params.size()) { - MS_LOG(INFO) << "node: " << dst_node->name << " has " << dst_node->inputIndex.size() << ", but only has" + MS_LOG(INFO) << "node: " << dst_node->name << " has " << dst_node->inputIndex.size() << " input, but only has " << input_quant_params.size() << " quant params"; break; } @@ -176,11 +176,15 @@ int AnfExporter::ConvertQuantParam(const std::unique_ptr &me } } - // output - int output_idx = 0; - for (const auto &output_quant_param : output_quant_params) { - auto output_tensor = meta_graph->allTensors[dst_node->outputIndex[output_idx]].get(); - output_idx++; + // output_quant_params + for (size_t index = 0; index < dst_node->outputIndex.size(); ++index) { + if (index >= output_quant_params.size()) { + MS_LOG(INFO) << "node: " << dst_node->name << " has " << dst_node->outputIndex.size() << " output, but only has" + << output_quant_params.size() << " quant params"; + break; + } + auto output_tensor = meta_graph->allTensors[dst_node->outputIndex[index]].get(); + auto &output_quant_param = output_quant_params[index]; for (const auto &channel_quant_param : output_quant_param) { if (output_tensor->quantParams.empty() && dst_node->quantType != schema::QuantType_WeightQuant) { std::unique_ptr output_quant_param_ptr = @@ -191,6 +195,7 @@ int AnfExporter::ConvertQuantParam(const std::unique_ptr &me } } } + return RET_OK; }