diff --git a/mindspore/lite/test/models_tflite.cfg b/mindspore/lite/test/models_tflite.cfg index 13f1db88dc47f4095132e8e3f5b65ebe62e78fe8..b7352587823abf35af7738b069dfab297fe31676 100644 --- a/mindspore/lite/test/models_tflite.cfg +++ b/mindspore/lite/test/models_tflite.cfg @@ -56,6 +56,7 @@ nasnet_large.tflite model_emotions_0727_nosoftmax.tflite inception_resnet_v2.tflite ml_ocr_latin.tflite +hiai_PoseEstimation_Pcm.tflite hiai_ssd_mobilenetv2_object.tflite hiai_cv_focusShootOCRModel_02.tflite hiai_cv_poseEstimation.tflite diff --git a/mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.cc b/mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.cc index 67c815c80566ca2909abd10d739d5b6433871f77..c779465eeb668ca3c89942e0fa202baf3d0172bc 100644 --- a/mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.cc +++ b/mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.cc @@ -23,7 +23,6 @@ #include "schema/inner/model_generated.h" #include "tools/optimizer/common/gllo_utils.h" - namespace mindspore::opt { namespace { constexpr size_t kActivationInputsLength = 2; @@ -68,14 +67,18 @@ const AnfNodePtr ConvActivationFusion::Process(const FuncGraphPtr &func_graph, c MS_ASSERT(utils::isa>(primitive_c)); auto primc = utils::cast>(primitive_c); MS_ASSERT(primc != nullptr); - primc->SetActivationType(activation_type); - return pre_node; + if (primc->GetActivationType() == schema::ActivationType_NO_ACTIVATION) { + primc->SetActivationType(activation_type); + return pre_node; + } } else if (node_type == schema::PrimitiveType_DepthwiseConv2D) { MS_ASSERT(utils::isa>(primitive_c)); auto primc = utils::cast>(primitive_c); MS_ASSERT(primc != nullptr); - primc->SetActivationType(activation_type); - return pre_node; + if (primc->GetActivationType() == schema::ActivationType_NO_ACTIVATION) { + primc->SetActivationType(activation_type); + return pre_node; + } } else { MS_LOG(EXCEPTION) << "conv activation pass match only conv2d or depthwise_conv2d "; }