Browse Source

!4711 fix caffe/onnx fc parser

Merge pull request !4711 from lyvette/tflite_parser
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
b698926725
3 changed files with 3 additions and 8 deletions
  1. +1
    -7
      mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc
  2. +1
    -0
      mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc
  3. +1
    -1
      mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc

+ 1
- 7
mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc View File

@@ -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<schema::FullConnectionT> 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<schema::FlattenT> attr = std::make_unique<schema::FlattenT>();

op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Flatten;


+ 1
- 0
mindspore/lite/tools/converter/parser/caffe/caffe_innerproduct_parser.cc View File

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


+ 1
- 1
mindspore/lite/tools/converter/parser/onnx/onnx_deconv_parser.cc View File

@@ -49,7 +49,7 @@ bool OnnxDeConvParser::ParseGroupDeConvolution(schema::CNodeT *op, schema::DeCon
deDepthwiseConv2DParam->activationType = attr->activationType;
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_DepthwiseConv2D;
op->primitive->value.type = schema::PrimitiveType_DeDepthwiseConv2D;
delete (op->primitive->value.value);
op->primitive->value.value = deDepthwiseConv2DParam;
}


Loading…
Cancel
Save