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

大兄弟,可以更新ncnn的版本了,最新版本测试了一下,速度翻了一倍,实时检测毫无压力了... #7

Open
abc1225 opened this issue Apr 11, 2018 · 17 comments

Comments

@abc1225
Copy link

abc1225 commented Apr 11, 2018

No description provided.

@rivercn
Copy link

rivercn commented Apr 11, 2018

Build command failed.
Error while executing '/home/river/Android/Sdk/cmake/3.6.4111459/bin/cmake' with arguments {--build /home/river/AndroidStudioProjects/mtcnn_AS_1/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target mtcnn}
[1/3] Building CXX object CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn.cpp.o
[2/3] Building CXX object CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn_jni.cpp.o
[3/3] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libmtcnn.so
FAILED: : && /home/river/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/river/Android/Sdk/ndk-bundle/sysroot -fPIC -isystem /home/river/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=17 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fopenmp -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -std=c++11 -frtti -fexceptions -O0 -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/river/Android/Sdk/ndk-bundle/platforms/android-17/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libmtcnn.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libmtcnn.so CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn.cpp.o CMakeFiles/mtcnn.dir/src/main/cpp/mtcnn_jni.cpp.o ../../../../src/main/jniLibs/armeabi-v7a/libncnn.a -ljnigraphics -lz /home/river/Android/Sdk/ndk-bundle/platforms/android-17/arch-arm/usr/lib/liblog.so -latomic -lm "/home/river/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function ncnn::Mat::substract_mean_normalize(float const*, float const*): error: undefined reference to '__kmpc_fork_call'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined.: error: undefined reference to '__kmpc_for_static_init_4'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined.: error: undefined reference to '__kmpc_for_static_fini'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..1: error: undefined reference to '__kmpc_for_static_init_4'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..1: error: undefined reference to '__kmpc_for_static_fini'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..2: error: undefined reference to '__kmpc_for_static_init_4'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..2: error: undefined reference to '__kmpc_for_static_fini'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function ncnn::copy_make_border(ncnn::Mat const&, ncnn::Mat&, int, int, int, int, int, float): error: undefined reference to '__kmpc_fork_call'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..3: error: undefined reference to '__kmpc_for_static_init_4'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function .omp_outlined..3: error: undefined reference to '__kmpc_for_static_fini'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function ncnn::copy_cut_border(ncnn::Mat const&, ncnn::Mat&, int, int, int, int): error: undefined reference to '__kmpc_fork_call'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(mat.cpp.o):/home/nihui/osd/ncnn/src/mat.cpp:function ncnn::resize_bilinear(ncnn::Mat const&, ncnn::Mat&, int, int): error: undefined reference to '__kmpc_fork_call'
../../../../src/main/jniLibs/armeabi-v7a/libncnn.a(convolutiondepthwise.cpp.o):/home/nihui/osd/ncnn/src/layer/convolutiondepthwise.cpp:function .omp_outlined..1: error: undefined reference to '__kmpc_for_static_init_8'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

新版本编译出现这个错误, openmp的问题,你遇到没

@abc1225
Copy link
Author

abc1225 commented Apr 11, 2018

gradle里配置的编译器把gcc修改为clang,arguments "-DANDROID_TOOLCHAIN=clang"

@rivercn
Copy link

rivercn commented Apr 11, 2018

@abc1225 搞定了,非常感谢!
测试4线程时整体速度是提升了,但是单线程模式的速度感觉反而降低的,准备换手机测试看!

@abc1225
Copy link
Author

abc1225 commented Apr 11, 2018

@rivercn 测完了告诉一下哈

@moli232777144
Copy link
Owner

之前尝试过更新版本的,新版需设置clang编译了,我这边尝试过,一直报下面这个错误,没找到解决方法,你们还修改过其他编译细节吗?或者是我需要更新软件某个版本?麻烦告知下;
Error:cannot find -lomp
Error:error: linker command failed with exit code 1 (use -v to see
invocation)

@abc1225
Copy link
Author

abc1225 commented Apr 12, 2018

@moli232777144 没其它细节了,仅替换了lib库和头文件,gcc修改为clang,你这个的只能是ndk版本导致的问题,ndk版本号: 15.1.4xxx
2018-04-12_084120

@rivercn
Copy link

rivercn commented Apr 12, 2018

@abc1225 初步测试单线程是有上升,单张图片的时间跟视频的时间有差别,需要进一步验证

@abc1225
Copy link
Author

abc1225 commented Apr 12, 2018

@rivercn thanks

@moli232777144
Copy link
Owner

更新了相关可调参数的接口和测试数据,个人机子上测试,速度反而没之前版本快;mtcnn通过框架提升速度的空间可能不大了,模型计算量并不大,波动反而可能更大;欢迎测试交流下;

@Roger8
Copy link

Roger8 commented May 31, 2018

@abc1225 ,已按照你说的修改,请问这个是什么原因
Information:Gradle tasks [:app:assembleDebug]
Error:error: linker command failed with exit code 1 (use -v to see invocation)

@moli232777144
Copy link
Owner

@Roger8 升级ndk

@Roger8
Copy link

Roger8 commented Jun 1, 2018

ndk版本由17换为r15后编译成功,3q

@arvrschool
Copy link

有多快呢?我在Android上跑人脸检测,很不稳定,每帧耗时波动比较大

@pxEkin
Copy link

pxEkin commented Nov 14, 2018

更新了相关可调参数的接口和测试数据,个人机子上测试,速度反而没之前版本快;mtcnn通过框架提升速度的空间可能不大了,模型计算量并不大,波动反而可能更大;欢迎测试交流下;

嗯,我这边测试也是,用ncnn官方编译库,20180427的库比20180830的库还要快一些

@pxEkin
Copy link

pxEkin commented Nov 14, 2018

有多快呢?我在Android上跑人脸检测,很不稳定,每帧耗时波动比较大

我跑也有几十毫秒到上百毫秒的波动

@galileolvpo
Copy link

我测下来线程越多,速度越慢....

@Captain1986
Copy link

之前尝试过更新版本的,新版需设置clang编译了,我这边尝试过,一直报下面这个错误,没找到解决方法,你们还修改过其他编译细节吗?或者是我需要更新软件某个版本?麻烦告知下;
Error:cannot find -lomp
Error:error: linker command failed with exit code 1 (use -v to see
invocation)

openmp?

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

8 participants