fix conv parser of onnx

This commit is contained in:
yankai 2020-10-27 22:50:14 +08:00
parent cd3ab211a3
commit 35ccbdda46
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@
namespace mindspore {
namespace lite {
constexpr int32_t kSingleGrounp = 1;
bool OnnxConvParser::ParseGroupConvolution(const std::unique_ptr<schema::Conv2DT> &attr, schema::CNodeT *op) {
MS_LOG(DEBUG) << "onnx DepthwiseConvParser";
if (attr == nullptr || attr->group != attr->channelIn) {
@ -171,7 +172,7 @@ STATUS OnnxConvParser::Parse(const onnx::GraphProto &onnx_graph, const onnx::Nod
attr->activationType = schema::ActivationType_NO_ACTIVATION;
}
if (attr->group == attr->channelOut) {
if (attr->group > kSingleGrounp) {
if (!ParseGroupConvolution(attr, op)) {
MS_LOG(ERROR) << "Convert Convolution to Depthwise failed";
return RET_ERROR;