-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
out.h w c are all zero after replacing my own .so file #438
Comments
I found that the return value of load_param and load_model are 0. so weird... I didn't change the model. |
After digging into the source code, I think it runs into if (magic != 7767517) |
the model bundled in squeezencnn-AS project is too old to work with the latest ncnn libraray. try replacing model files with the latest version in ncnn repo |
Thanks for your reply. I change the whole project to ncnn/examples/squeezencnn and use both prebuild and my own .a files, however, the result is same as before. ret = 0 from load_param and load_ model |
Okay, I solve the problem and you are right. The model in ncnn-mobile repo is too old to be used. Please forget my last comment, I might have something wrong with my operations. To conclude, I solved the problem after I replace the ncnn-mobile project with the project in ncnn/examples/squeezencnn. Thanks :) |
I found that my matrix out is empty
ncnn::Mat out;
ex.extract(squeezenet_v1_1_param_id::BLOB_prob, out);
I have read #391 #248 #396, and none of their solution can solve my problem. Below is my building steps,
build .a file for android according to the article https://github.com/Tencent/ncnn/wiki/cmake-%E6%89%93%E5%8C%85-android-sdk
modify Android.mk file in ncnn-mobile squeezencnn-AS app (https://github.com/dangbo/ncnn-mobile), just change NCNN_INSTALL_PATH := /my/path/to/ncnn/build-android/install
modify Application.mk file by commend NDK_TOOLCHAIN_VERSION := 4.9 (same as 为什么我拿ncnn编译出来的.a文件编译so的时候会报undefined reference to '__kmpc_fork_call'的错误 #292 )
generate libsqueezencnn.so by ndk-build
During the above process, I didn't get any error message, however, the result is wrong. The output is alway "tench, Tinca, tinca = 0.000" and out.c out.w out.h are all zero. I use the original model and code as ncnn-mobile squeezencnn-AS provides.
I use Android Studio 3.1.2 on macOS High Sierra with ndk-r16b. Actually the prebuild .a file is not working for me either.
Thanks.
The text was updated successfully, but these errors were encountered: