Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android调用mat.h的resize_bilinear时出现floating-point exception #2917

Open
yihenxi opened this issue May 17, 2021 · 4 comments
Open

Android调用mat.h的resize_bilinear时出现floating-point exception #2917

yihenxi opened this issue May 17, 2021 · 4 comments

Comments

@yihenxi
Copy link

yihenxi commented May 17, 2021

ncnn-android-lib.zip 版本为https://github.com/Tencent/ncnn/releases/tag/20210322

#2 pc 000573cd /data/app/com.jinxin.namibox-4_QRJUbw2X4gIYPGhjy50g==/lib/arm/libmtcnn.so (ncnn::Mat::create(int, int, int, unsigned int, int, ncnn::Allocator*)+156) [armeabi-v7a]
4
#3 pc 001635c1 /data/app/com.jinxin.namibox-4_QRJUbw2X4gIYPGhjy50g==/lib/arm/libmtcnn.so (ncnn::Interp_arm::forward(std::__ndk1::vector<ncnn::Mat, std::__ndk1::allocatorncnn::Mat > const&, std::__ndk1::vector<ncnn::Mat, std::__ndk1::allocatorncnn::Mat >&, ncnn::Option const&) const+240) [armeabi-v7a]
5
#4 pc 00161a1f /data/app/com.jinxin.namibox-4_QRJUbw2X4gIYPGhjy50g==/lib/arm/libmtcnn.so (ncnn::Interp::forward(ncnn::Mat const&, ncnn::Mat&, ncnn::Option const&) const+498) [armeabi-v7a]
6
#5 pc 0004ef67 /data/app/com.jinxin.namibox-4_QRJUbw2X4gIYPGhjy50g==/lib/arm/libmtcnn.so (ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Option const&)+110) [armeabi-v7a]

@nihui
Copy link
Member

nihui commented May 20, 2021

看mtcnn.so,怀疑是 resize_bilinear 之前,copy_cut_border 的参数为负数,导致crop失败传入空 Mat ?

@yihenxi
Copy link
Author

yihenxi commented May 24, 2021

“参数为负数” ----》》》resize_bilinear(img, in, ws, hs); 请问是这里的ws和hs吗?

@yihenxi
Copy link
Author

yihenxi commented May 24, 2021

copy_cut_border(img, tempIm, (*it).y1, img_h-(*it).y2, (*it).x1, img_w-(*it).x2); 这是copy_cut_border

@yihenxi
Copy link
Author

yihenxi commented May 24, 2021

这个是在PNet函数处发生的崩溃,在这之前没有做copy_cut_border操作

`void MTCNN::PNet(float scale)
{
//first stage
int hs = (int)ceil(img_hscale);
int ws = (int)ceil(img_w
scale);

ncnn::Mat in;
resize_bilinear(img, in, ws, hs);
ncnn::Extractor ex = Pnet.create_extractor();
ex.set_light_mode(true);
ex.set_num_threads(num_threads);
ex.input("data", in);
ncnn::Mat score_, location_;
ex.extract("prob1", score_);
ex.extract("conv4-2", location_);
std::vector<Bbox> boundingBox_;

generateBbox(score_, location_, boundingBox_, scale);
nms(boundingBox_, nms_threshold[0]);

firstBbox_.insert(firstBbox_.end(), boundingBox_.begin(), boundingBox_.end());
boundingBox_.clear();

}`

#01 pc 00210673 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (__aeabi_idiv0+6) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]

3 #2 pc 000573cd /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (ncnn::Mat::create(int, int, int, unsigned int, int, ncnn::Allocator*)+156) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
4 #3 pc 001635c1 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (ncnn::Interp_arm::forward(std::__ndk1::vector<ncnn::Mat, std::__ndk1::allocatorncnn::Mat > const&, std::__ndk1::vector<ncnn::Mat, std::__ndk1::allocatorncnn::Mat >&, ncnn::Option const&) const+240) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
5 #4 pc 00161a1f /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (ncnn::Interp::forward(ncnn::Mat const&, ncnn::Mat&, ncnn::Option const&) const+498) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
6 #5 pc 0004ef67 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int, ncnn::Option const&)+110) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
7 #6 pc 00049195 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (MTCNN::PNet(float)+144) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
8 #7 pc 0004a105 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (MTCNN::detectMaxFace(ncnn::Mat&, std::__ndk1::vector<Bbox, std::__ndk1::allocator >&)+340) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]
9 #8 pc 0004df11 /data/app/com.jinxin.namibox-5ZZ5a-qR7o1gX1rpNi_7cA==/lib/arm/libmtcnn.so (Java_com_jinxin_namibox_ncnn_MTCNN_MaxFaceDetect+352) [armeabi-v7a::1dda145aaa18d0473091f469cef87ae3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants