提交 78a44bcd 编写于 作者: G gongdaguo

add modlues and converter bug repair

上级 0f4e6d73
...@@ -56,6 +56,7 @@ nasnet_large.tflite ...@@ -56,6 +56,7 @@ nasnet_large.tflite
model_emotions_0727_nosoftmax.tflite model_emotions_0727_nosoftmax.tflite
inception_resnet_v2.tflite inception_resnet_v2.tflite
ml_ocr_latin.tflite ml_ocr_latin.tflite
hiai_PoseEstimation_Pcm.tflite
hiai_ssd_mobilenetv2_object.tflite hiai_ssd_mobilenetv2_object.tflite
hiai_cv_focusShootOCRModel_02.tflite hiai_cv_focusShootOCRModel_02.tflite
hiai_cv_poseEstimation.tflite hiai_cv_poseEstimation.tflite
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "schema/inner/model_generated.h" #include "schema/inner/model_generated.h"
#include "tools/optimizer/common/gllo_utils.h" #include "tools/optimizer/common/gllo_utils.h"
namespace mindspore::opt { namespace mindspore::opt {
namespace { namespace {
constexpr size_t kActivationInputsLength = 2; constexpr size_t kActivationInputsLength = 2;
...@@ -68,14 +67,18 @@ const AnfNodePtr ConvActivationFusion::Process(const FuncGraphPtr &func_graph, c ...@@ -68,14 +67,18 @@ const AnfNodePtr ConvActivationFusion::Process(const FuncGraphPtr &func_graph, c
MS_ASSERT(utils::isa<std::shared_ptr<mindspore::lite::Conv2D>>(primitiveT_value)); MS_ASSERT(utils::isa<std::shared_ptr<mindspore::lite::Conv2D>>(primitiveT_value));
auto primc = utils::cast<std::shared_ptr<mindspore::lite::Conv2D>>(primitiveT_value); auto primc = utils::cast<std::shared_ptr<mindspore::lite::Conv2D>>(primitiveT_value);
MS_ASSERT(primc != nullptr); MS_ASSERT(primc != nullptr);
primc->SetActivationType(activation_type); if (primc->GetActivationType() == schema::ActivationType_NO_ACTIVATION) {
return pre_node; primc->SetActivationType(activation_type);
return pre_node;
}
} else if (node_type == schema::PrimitiveType_DepthwiseConv2D) { } else if (node_type == schema::PrimitiveType_DepthwiseConv2D) {
MS_ASSERT(utils::isa<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(primitiveT_value)); MS_ASSERT(utils::isa<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(primitiveT_value));
auto primc = utils::cast<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(primitiveT_value); auto primc = utils::cast<std::shared_ptr<mindspore::lite::DepthwiseConv2D>>(primitiveT_value);
MS_ASSERT(primc != nullptr); MS_ASSERT(primc != nullptr);
primc->SetActivationType(activation_type); if (primc->GetActivationType() == schema::ActivationType_NO_ACTIVATION) {
return pre_node; primc->SetActivationType(activation_type);
return pre_node;
}
} else { } else {
MS_LOG(EXCEPTION) << "conv activation pass match only conv2d or depthwise_conv2d "; MS_LOG(EXCEPTION) << "conv activation pass match only conv2d or depthwise_conv2d ";
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册