Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An onnx model with reduceMean & reduceMax op craches during forward #21093

Closed
Labels
@ee-lynn

Description

@ee-lynn
System information (version)
  • OpenCV => 4.5.4
  • Operating System / Platform => Ubuntu 18.04
  • Compiler => gcc 7.5
Detailed description
Steps to reproduce
   void opencv_verify(const std::string& model_name)   {      cv::dnn::Net net = cv::dnn::readNet(model_name);      cv::Mat img = cv::Mat::zeros(192, 128, CV_8UC3);      cv::Mat blob = cv::dnn::blobFromImage(img, 1.0 / 255.0, { 192, 128 }, {103.53,  116.28, 123.675}, true);      net.setInput(blob, {std::string("input")});       std::vector<cv::Mat> detectionMat;      net.forward(detectionMat, {std::string("output_w"),std::string("output_h")});// 6 845 1 W x H x C    }

It produces the following:

[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3553) getLayerShapesRecursively OPENCV/DNN: [Reshape]:(2296): getMemoryShapes() throws exception. inputs=1 outputs=1/1 blobs=0
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3556) getLayerShapesRecursively input[0] = [ 1 15 -2147483648 48 ]
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3560) getLayerShapesRecursively output[0] = [ ]
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3566) getLayerShapesRecursively Exception message: OpenCV(4.5.4-dev) /home/shaoqi.lsq/opencv/modules/dnn/src/layers/reshape_layer.cpp:106: error: (-215:Assertion failed) total(srcShape, srcRange.start, srcRange.end) == maskTotal in function 'computeShapeByReshapeMask'

I have checked the ONNXimport, the output blobs of reduce mean& reduce max layer's shape are right, i cannot figure out why it crashes during runtime and why -2147483648 appears in the shape.

The onnx model can be obtain here "http://alg-misc.cn-hangzhou.oss.aliyun-inc.com/person%2Fshaoqi.lsq%2Fhrnet_w32.onnx?Expires=1952593883&OSSAccessKeyId=Oo2cqQNkidSaUBIN&Signature=lgLPwpMtEjJkkgG%2BGSkDFrk1dSo%3D"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp