!23717 [MS][LITE] code check and fix memory leak in tflite model parser

Merge pull request !23717 from XianglongZeng/myms_new
This commit is contained in:
i-robot 2021-09-22 03:55:11 +00:00 committed by Gitee
commit c3ce92a9f2
9 changed files with 18 additions and 11 deletions

View File

@ -123,9 +123,10 @@ hdc_ocr_recog_horizontal;1:input
ml_Heatmap_depth_240180;2:depth,heatmaps_point
ml_Heatmap_depth_180240;2:depth,heatmaps_point
ml_video_edit_person_divison_video;2:blob1,blob2
ml_video_edit_hair_dyeing_segmodel_v2;1:data
ml_video_edit_hair_dyeing_segmodel_v3;1:data
ml_video_edit_hairline_segmentation;3:blob1,blob2,blob3
ml_motion_capture_spin-mobile;4
ml_motion_capture_spin-res50;4
ml_motion_capture_spin-res50-poolingnoceilmode;4
ml_motion_capture_yolov3-spp-deploy_ddk_prune
ml_video_edit_seg_320;1:blob1

View File

@ -131,9 +131,10 @@ hdc_ocr_recog_horizontal 0.5
# The outputs of two Heatmap_depth models have small value
ml_Heatmap_depth_240180;2 10
ml_Heatmap_depth_180240;2 7
ml_video_edit_hair_dyeing_segmodel_v2 1
ml_video_edit_hair_dyeing_segmodel_v3 0.5
ml_video_edit_hairline_segmentation;3 1.5
ml_motion_capture_spin-mobile;4 1.5
ml_motion_capture_spin-res50;4 1.5
ml_motion_capture_spin-res50-poolingnoceilmode;4 1.5
ml_motion_capture_yolov3-spp-deploy_ddk_prune 6
ml_video_edit_seg_320 0.5

View File

@ -84,7 +84,7 @@ ml_video_edit_art_transfer.onnx;3 3
ml_video_edit_enhance_update_tmp.onnx 0.5
ml_video_edit_art_generate_20210513.onnx 0.5
ml_video_edit_art_transfer_20210513.onnx;3 0.5
ml_video_edit_hair_dyeing_segmodel_v2 0.5
ml_video_edit_hair_dyeing_segmodel_v3 0.5
ml_video_edit_makeup_mobilenetv203.onnx 2
ml_video_edit_hairline_segmentation;3 0.5
ml_video_edit_hair_dyeing_migrate_v2.onnx;4 0.5
@ -97,3 +97,4 @@ ml_motion_capture_spin-res50;4 1
ml_motion_capture_spin-res50-poolingnoceilmode;4 1
ml_video_edit_hair_dyeing_migrate_v2_fix.onnx;4 1.5
ml_motion_capture_yolov3-spp-deploy_ddk_prune 1
ml_video_edit_seg_320 0.5

View File

@ -70,5 +70,5 @@ ml_video_edit_enhance_update_tmp.onnx 0.5
#ml_video_edit_art_generate_20210513.onnx, output is out of range
# ConstructSubgraph change, adjust threshold(3->29) for nlu temporary
ml_video_edit_art_transfer_20210513.onnx;3 29
ml_video_edit_hair_dyeing_segmodel_v2 0.5
ml_video_edit_hair_dyeing_segmodel_v3 0.5
ml_video_edit_makeup_mobilenetv203.onnx 2

View File

@ -1 +1 @@
ml_video_edit_hair_dyeing_segmodel_v2 1.5
ml_video_edit_hair_dyeing_segmodel_v3 1.5

View File

@ -10,7 +10,7 @@ ml_video_edit_generate_filter.pb 23
ml_video_edit_hairSeg_have_imageProcessLayer_interpTo145 3
ml_video_edit_hairSeg_have_imageProcessLayer_interpTo145_20210121 3
ml_video_edit_hair_dyeing_migrate_v2.onnx;4 14
ml_video_edit_hair_dyeing_segmodel_v2 4
ml_video_edit_hair_dyeing_segmodel_v3 4
ml_video_edit_hairline_segmentation;3 13
ml_video_edit_have_imageProcessLayer_interpTo145_20201015 2
ml_video_edit_img_segment 30

View File

@ -38,10 +38,10 @@ std::string FunctionalizeControlOpPass::NodeClusterName(const AnfNodePtr &node)
std::string cluster_name{};
// tf node name use '/' split node name
auto cnode = utils::cast<CNodePtr>(node);
std::string keyword = "while/";
size_t pos = cnode->fullname_with_scope().rfind(keyword);
std::string word_in_name = "while/";
size_t pos = cnode->fullname_with_scope().rfind(word_in_name);
if (pos != std::string::npos) {
cluster_name = cnode->fullname_with_scope().substr(0, pos + keyword.size());
cluster_name = cnode->fullname_with_scope().substr(0, pos + word_in_name.size());
} else {
cluster_name = cnode->fullname_with_scope();
}

View File

@ -34,7 +34,12 @@ class TfliteModelParser : public converter::ModelParser {
public:
TfliteModelParser() = default;
~TfliteModelParser() override = default;
~TfliteModelParser() override {
if (tflite_model_buf_ != nullptr) {
delete[] tflite_model_buf_;
tflite_model_buf_ = nullptr;
}
}
api::FuncGraphPtr Parse(const converter::ConverterParameters &flag) override;

View File

@ -227,6 +227,5 @@ AnfNodePtr ConvPadFusion::Process(const std::string &pattern_name, const FuncGra
ReplaceParamsAndNodes(func_graph, conv_cnode, pad_cnode, pattern_name);
return nullptr;
}
} // namespace opt
} // namespace mindspore