diff --git a/mindspore/lite/src/ops/strided_slice.cc b/mindspore/lite/src/ops/strided_slice.cc index b7905e0beff..e09bed17612 100644 --- a/mindspore/lite/src/ops/strided_slice.cc +++ b/mindspore/lite/src/ops/strided_slice.cc @@ -254,18 +254,17 @@ int StridedSlice::InferShape(std::vector inputs, std::vectorset_data_type(input->data_type()); outputs[0]->SetFormat(input->GetFormat()); - if (!GetInferFlag()) { - return RET_OK; - } MS_ASSERT(input != nullptr); auto input_shape = input->shape(); - std::vector output_shape; + auto inferflag = GetInferFlag(); if (inputs.size() == kStridedSliceInputNum) { ndim_ = static_cast(GetBegin().size()); for (int i = 0; i < ndim_; i++) { - in_shape_.emplace_back(input_shape.at(i)); + if (inferflag) { + in_shape_.emplace_back(input_shape.at(i)); + } begins_.emplace_back((GetBegin())[i]); ends_.emplace_back((GetEnd())[i]); strides_.emplace_back((GetStride())[i]); @@ -282,7 +281,9 @@ int StridedSlice::InferShape(std::vector inputs, std::vectorElementsNum(); for (int i = 0; i < ndim_; ++i) { - in_shape_.emplace_back(input_shape.at(i)); + if (inferflag) { + in_shape_.emplace_back(input_shape.at(i)); + } begins_.emplace_back(begin_data[i]); ends_.emplace_back(end_data[i]); strides_.emplace_back(stride_data[i]); @@ -310,6 +311,10 @@ int StridedSlice::InferShape(std::vector inputs, std::vector output_shape; output_shape.clear(); output_shape.resize(in_shape_.size()); diff --git a/mindspore/lite/test/models_onnx.cfg b/mindspore/lite/test/models_onnx.cfg index 6f44c13931b..b52284e3d0e 100644 --- a/mindspore/lite/test/models_onnx.cfg +++ b/mindspore/lite/test/models_onnx.cfg @@ -1,6 +1,7 @@ mtk_detect-mbv2-shortcut-400-400-simplified.onnx mtk_emotions-d2012-75.8%.onnx mtk_face_features_v3.onnx +emotion-ferplus-8.onnx ml_face_3d.onnx gts_version-RFB-320_simplified.onnx mnist-8.onnx diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_pool_parser.cc b/mindspore/lite/tools/converter/parser/onnx/onnx_pool_parser.cc index 105f6ca3740..2421a2038f3 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_pool_parser.cc +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_pool_parser.cc @@ -89,7 +89,11 @@ STATUS OnnxPoolParser::Parse(const onnx::GraphProto &onnx_graph, const onnx::Nod } } if (attribute_name == "ceil_mode") { - attr->roundMode = schema::RoundMode_CEIL; + if (onnx_node_attr.f() == 0) { + attr->roundMode = schema::RoundMode_FLOOR; + } else { + attr->roundMode = schema::RoundMode_CEIL; + } } if (attribute_name == "dilations") { MS_LOG(ERROR) << "pooling op not support dilations now";