diff --git a/modules/dnn/src/layers/crop_and_resize_layer.cpp b/modules/dnn/src/layers/crop_and_resize_layer.cpp index ba11c33508..261706a78e 100644 --- a/modules/dnn/src/layers/crop_and_resize_layer.cpp +++ b/modules/dnn/src/layers/crop_and_resize_layer.cpp @@ -125,7 +125,8 @@ public: auto input = nodes[0].dynamicCast()->node; auto rois = nodes[1].dynamicCast()->node; - std::vector dims = rois->get_shape(), offsets(4, 0); + auto rois_shape = rois->get_shape(); + std::vector dims(rois_shape.begin(), rois_shape.end()), offsets(4, 0); offsets[3] = 2; dims[3] = 7; @@ -139,7 +140,7 @@ public: lower_bounds, upper_bounds, strides, std::vector{}, std::vector{}); // Reshape rois from 4D to 2D - std::vector shapeData = {dims[2], 5}; + std::vector shapeData = {dims[2], 5}; auto shape = std::make_shared(ngraph::element::i64, ngraph::Shape{2}, shapeData.data()); auto reshape = std::make_shared(slice, shape, true);