提交 1a2642ad 编写于 作者: L lyvette

modify fc caffe parser and deconv onnx parser

上级 ff2851a2
...@@ -24,13 +24,7 @@ STATUS CaffeFlattenParser::Parse(const caffe::LayerParameter &proto, const caffe ...@@ -24,13 +24,7 @@ STATUS CaffeFlattenParser::Parse(const caffe::LayerParameter &proto, const caffe
// MS_LOG(ERROR) << "null pointer dereferencing."; // MS_LOG(ERROR) << "null pointer dereferencing.";
return RET_NULL_PTR; return RET_NULL_PTR;
} }
std::unique_ptr<schema::FullConnectionT> attr(new schema::FullConnectionT()); std::unique_ptr<schema::FlattenT> attr = std::make_unique<schema::FlattenT>();
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;
op->primitive = std::make_unique<schema::PrimitiveT>(); op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Flatten; op->primitive->value.type = schema::PrimitiveType_Flatten;
......
...@@ -40,6 +40,7 @@ STATUS CaffeInnerProductParser::Parse(const caffe::LayerParameter &proto, const ...@@ -40,6 +40,7 @@ STATUS CaffeInnerProductParser::Parse(const caffe::LayerParameter &proto, const
if (innerProductParam.bias_term()) { if (innerProductParam.bias_term()) {
attr->hasBias = true; attr->hasBias = true;
} }
attr->activationType = schema::ActivationType_NO_ACTIVATION;
// parse weight // parse weight
if (weight.blobs_size() == 0) { if (weight.blobs_size() == 0) {
......
...@@ -49,7 +49,7 @@ bool OnnxDeConvParser::ParseGroupDeConvolution(schema::CNodeT *op, schema::DeCon ...@@ -49,7 +49,7 @@ bool OnnxDeConvParser::ParseGroupDeConvolution(schema::CNodeT *op, schema::DeCon
deDepthwiseConv2DParam->activationType = attr->activationType; deDepthwiseConv2DParam->activationType = attr->activationType;
if (op != nullptr) { if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>(); 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); delete (op->primitive->value.value);
op->primitive->value.value = deDepthwiseConv2DParam; op->primitive->value.value = deDepthwiseConv2DParam;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册