diff --git a/paddle/operators/detection_output_op.h b/paddle/operators/detection_output_op.h index 74a609d0a421ae86cbe591b4eaca421bfb3f143f..510d82251d8c96ad06b7bbbd301ec345d269ab50 100644 --- a/paddle/operators/detection_output_op.h +++ b/paddle/operators/detection_output_op.h @@ -71,10 +71,11 @@ class Detection_output_Kernel : public framework::OpKernel { framework::make_ddim(conf_shape_softmax_vec)); // for knchw => nhwc std::vector loc_shape_vec({1, in_loc->dims()[1], in_loc->dims()[3], - in_loc->dims()[4], in_loc->dims()[2]}); - std::vector conf_shape_vec({1, in_conf->dims()[1], - in_conf->dims()[3], in_conf->dims()[4], - in_conf->dims()[2]}); + in_loc->dims()[4], + in_loc->dims()[2] * in_loc->dims()[0]}); + std::vector conf_shape_vec( + {1, in_conf->dims()[1], in_conf->dims()[3], in_conf->dims()[4], + in_conf->dims()[2] * in_conf->dims()[0]}); framework::DDim loc_shape(framework::make_ddim(loc_shape_vec)); framework::DDim conf_shape(framework::make_ddim(conf_shape_vec)); framework::Tensor loc_tensor;