ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Depending on the version of ncnn, the size of the output varied.

Open nnn112358 opened this issue 1 year ago • 0 comments

Problem Description

In the case of loading a specific model,older than ncnn version:Tags=20221128, Matrix's height outputs "1 array". If the model is newer than ncnn version:Tags=20230223, Matrix's height will output an array of "8 arrays".

The specific model is placed below. https://github.com/nnn112358/handpose_ncnn_test/tree/main/model

Expected Behavior

My expected result is that Matrix's height outputs one array. Older than Tags=20221128 is the expected result. (Matrix's height =1 array) Newer than Tags=20230223 is not the expected result. (Matrix's height =8 array) Only the size of the array changed, while at the same time the values of the array were changed. I would like to know why ncnn version made this change.

Environment

gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) ncnn version Tags=20220729〜20231027 OpenCV version 4.4.0

Code to reproduce this issue

The full source code is long, so it is stored below. https://github.com/nnn112358/handpose_ncnn_test/blob/main/nanodet_hand_test.cpp

    ncnn::Extractor ex = nanopnt.create_extractor();
    ex.input("input", in);

    ncnn::Mat points, score;
    ex.extract("points", points);
    ex.extract("score", score);

    std::cout << " score.w   = " << score.w << " score.h   = " << score.h << " ";
    std::cout << " score.c   =" << score.c << " score.d  =" << score.d << " ";
    std::cout << " elemsize = " << score.elemsize << " elempack =" << score.elempack << std::endl;

    std::cout << " points.w = " << points.w << " points.h = " << points.h << " ";
    std::cout << " points.c =" << points.c << " points.d=" << points.d << " ";
    std::cout << " elemsize = " << points.elemsize << " elempack =" << points.elempack << std::endl;

Actual Behavior

ncnn version:Tags=20220729 case:
 score.w   = 1 score.h   = 1  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 1  points.c =1 points.d=1  elemsize = 4 elempack =1

ncnn version:Tags=20221128 case:
 score.w   = 1 score.h   = 1  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 1  points.c =1 points.d=1  elemsize = 4 elempack =1

ncnn version:Tags=20230223 case:
 score.w   = 1 score.h   = 8  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 8  points.c =1 points.d=1  elemsize = 4 elempack =1

ncnn version:Tags=20230517 case:
 score.w   = 1 score.h   = 8  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 8  points.c =1 points.d=1  elemsize = 4 elempack =1
ncnn version:Tags=

ncnn version:Tags=20230816 case:
 score.w   = 1 score.h   = 8  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 8  points.c =1 points.d=1  elemsize = 4 elempack =1

ncnn version:Tags=20231027 case:
 score.w   = 1 score.h   = 8  score.c   =1 score.d  =1  elemsize = 4 elempack =1
 points.w = 63 points.h = 8  points.c =1 points.d=1  elemsize = 4 elempack =1

nnn112358 avatar Nov 16 '23 11:11 nnn112358