!4992 add modlues and converter bug repair

Merge pull request !4992 from gongdaguo/add_modlues_converter_bug_repair
This commit is contained in:
mindspore-ci-bot 2020-08-24 20:07:42 +08:00 committed by Gitee
commit 7795b7cd22
2 changed files with 9 additions and 5 deletions

View File

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

View File

@ -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<std::shared_ptr<mindspore::lite::Conv2D>>(primitive_c));
auto primc = utils::cast<std::shared_ptr<mindspore::lite::Conv2D>>(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<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(primitive_c));
auto primc = utils::cast<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(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 ";
}