From 1a2642adecfba976da1348d18b18e0cfe2793862 Mon Sep 17 00:00:00 2001 From: lyvette Date: Tue, 18 Aug 2020 16:45:27 +0800 Subject: [PATCH] modify fc caffe parser and deconv onnx parser --- .../tools/converter/parser/caffe/caffe_flatten_parser.cc | 8 +------- .../converter/parser/caffe/caffe_innerproduct_parser.cc | 1 + .../tools/converter/parser/onnx/onnx_deconv_parser.cc | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc index 7f78c42b9..2e17f6ddd 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc @@ -24,13 +24,7 @@ STATUS CaffeFlattenParser::Parse(const caffe::LayerParameter &proto, const caffe // MS_LOG(ERROR) << "null pointer dereferencing."; return RET_NULL_PTR; } - std::unique_ptr attr(new schema::FullConnectionT()); - const caffe::FlattenParameter flattenParam = proto.flatten_param(); - - attr->axis = (int32_t)flattenParam.axis(); - attr->useAxis = true; - attr->hasBias = false; - attr->activationType = schema::ActivationType_NO_ACTIVATION; + std::unique_ptr attr = std::make_unique(); op->primitive = std::make_unique(); op->primitive->value.type = schema::PrimitiveType_Flatten; diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc index 5667132b4..1cc01dced 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc @@ -40,6 +40,7 @@ STATUS CaffeInnerProductParser::Parse(const caffe::LayerParameter &proto, const if (innerProductParam.bias_term()) { attr->hasBias = true; } + attr->activationType = schema::ActivationType_NO_ACTIVATION; // parse weight if (weight.blobs_size() == 0) { diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc b/mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc index c0ff09269..09236775f 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc @@ -49,7 +49,7 @@ bool OnnxDeConvParser::ParseGroupDeConvolution(schema::CNodeT *op, schema::DeCon deDepthwiseConv2DParam->activationType = attr->activationType; if (op != nullptr) { op->primitive = std::make_unique(); - op->primitive->value.type = schema::PrimitiveType_DepthwiseConv2D; + op->primitive->value.type = schema::PrimitiveType_DeDepthwiseConv2D; delete (op->primitive->value.value); op->primitive->value.value = deDepthwiseConv2DParam; } -- GitLab