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

k10s72fa  于 4个月前  发布在  Android
关注(0)|答案(4)|浏览(87)

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]

5lhxktic

5lhxktic1#

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

a0zr77ik

a0zr77ik2#

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

kmb7vmvb

kmb7vmvb3#

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

wvt8vs2t

wvt8vs2t4#

这个是在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]

相关问题