fix bug of failing to convert resnext50.mindir

This commit is contained in:
wangyanling 2021-06-28 09:24:11 +08:00
parent 19e95c5c8e
commit 1f7cb329b3
4 changed files with 13 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -155,7 +155,7 @@ int AnfExporter::ConvertQuantParam(const std::unique_ptr<schema::MetaGraphT> &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<schema::MetaGraphT> &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<schema::QuantParamT> output_quant_param_ptr =
@ -191,6 +195,7 @@ int AnfExporter::ConvertQuantParam(const std::unique_ptr<schema::MetaGraphT> &me
}
}
}
return RET_OK;
}