Giter Site home page Giter Site logo

Comments (11)

sh1r0 avatar sh1r0 commented on August 17, 2024 1

The exact error for using ANDROID_ABI="armeabi" is shown below:

caffe-android-lib/opencv/3rdparty/libwebp/cpu-features/cpu-features.c:61:0:
android-ndk-r10e/platforms/android-21/arch-arm/usr/include/machine/cpu-features.h:52:6: error: #error Unknown or unsupported ARM architecture

Perhaps, you can fix this error by using a lower api level (say android-19). But IMHO, I would not recommend you to run caffe on ARMv5 devices due to the concern for performance.

I just updated the master branch, and you could build caffe libs for aarch64 devices by setting ANDROID_ABI="arm64-v8a" (with USE_OPENBLAS=0).

from caffe-android-lib.

etjay avatar etjay commented on August 17, 2024

When i use export ANDROID_ABI="armeabi" got this error :

[ 50%] Built target pch_Generate_opencv_imgproc
[ 50%] [ 52%] [ 52%] [ 52%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfRgbaFile.cpp.o
Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfLineOrderAttribute.cpp.o
Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfRational.cpp.o
Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfChannelListAttribute.cpp.o
[ 52%] [ 52%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfKeyCodeAttribute.cpp.o
Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfTiledOutputFile.cpp.o
Linking CXX static library ../lib/armeabi/libIlmImf.a
[ 52%] Built target IlmImf
make: *** [all] Error 2

from caffe-android-lib.

etjay avatar etjay commented on August 17, 2024

@sh1r0 Thank you for help !

from caffe-android-lib.

keer2012 avatar keer2012 commented on August 17, 2024

I ran into the same issue.need help with it.
02-22 10:29:11.671 22055-22055/com.sh1r0.caffe_android_demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sh1r0.caffe_android_demo, PID: 22055
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "sigfillset" referenced by "libcaffe.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at com.sh1r0.caffe_android_demo.MainActivity.(MainActivity.java:53)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2271)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
at dalvik.system.NativeStart.main(Native Method)
02-22 10:34:12.061 22055-22055/? I/Process: Sending signal. PID: 22055 SIG: 9

Thxs,@sh1r0

from caffe-android-lib.

sh1r0 avatar sh1r0 commented on August 17, 2024

@keer2012 Did you build the libs with ANDROID_ABI="arm64-v8a"?

from caffe-android-lib.

mgarbade avatar mgarbade commented on August 17, 2024

Hi
I'm just facing the same error. I imported your project into Android-Studio and tried to run it from there on my Galaxy S10 Note (ARM Cortex-A9 MPCore 32-bit processor).
Where would you add this command ANDROID_ABI="arm64-v8a?
Do I need to compile the android project using a shell? (adb ? )
If yes, could you maybe give some example command?

from caffe-android-lib.

mgarbade avatar mgarbade commented on August 17, 2024

Ok I guess I'm getting closer: Apparantly there are two important git-repositories:

  1. caffe-android-lib
  2. caffe-android-demo

To compile 1) I need to run ./build.sh . The file build.sh itself contains the line export ANDROID_ABI="${ANDROID_ABI:-"armeabi-v7a with NEON"}" which I will probably have to change to export ANDROID_ABI="arm64-v8a" ?
But it's still not working, when I try to run the code from 2) in Android Studio on my device the error remains.
By the way: How does the code from 2) know where the compiled code of 1) is lying? Or do I need to add some path to the build path in 2) (caffe-android-demo) ?

from caffe-android-lib.

sh1r0 avatar sh1r0 commented on August 17, 2024

@keer2012 @mgarbade
To clarify, for supporting aarch64 devices:

  1. Build caffe-android-lib with ANDROID_ABI="arm64-v8a". This can be set by export ANDROID_ABI="arm64-v8a" before calling ./build.sh without modifying anything.
  2. If you hope to use caffe-android-demo on your aarch64 devices, you need to put the libs built from 1. in the right directory according to the abi. Please refer to https://github.com/sh1r0/caffe-android-demo/tree/master/app/src/main/jniLibs and http://developer.android.com/ndk/guides/abis.html for details.

from caffe-android-lib.

mgarbade avatar mgarbade commented on August 17, 2024

Thank you for your advice but I think the problem lies somewhere else.

After some googeling I'm know quite conviced that my Galaxy Note 10.1 (2014 Edition) features a 32bit "Qualcomm Snapdragon 800 MSM8974" Chipset which expects a ARMv7 instruction set.

Anyway I tried both copying the libcaffe.so and libcaffe_jni.so from caffe-android-lib to the caffe-android-demo compiled
a) with export ANDROID_ABI="arm64-v8a"
b) without it

Trying a) failed with the following error:
dlopen("/data/app-lib/com.sh1r0.caffe_android_demo-7/libcaffe.so") failed: dlopen failed: "/data/app-lib/com.sh1r0.caffe_android_demo-7/libcaffe.so" not 32-bit: 2
Trying b) fails on the above mentioned cannot locate symbol "sigfillset" referenced by "libcaffe.so"

I even started creating numerous Android Virtual Devices with API 15 and API 19 including
i) armeabi-v7a
ii) x86
But still the Running of the app crashes on boot-up.

Error when launching on a armeabi-v7a - Emulator:
Launching application: com.sh1r0.caffe_android_demo/com.sh1r0.caffe_android_demo.MainActivity.
DEVICE SHELL COMMAND: am start -D -n "com.sh1r0.caffe_android_demo/com.sh1r0.caffe_android_demo.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet.
Client not ready yet.
Client not ready yet.
Client not ready yet.
Client not ready yet.
Client not ready yet.
Client not ready yet.
Client not ready yet.
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sh1r0.caffe_android_demo/.MainActivity }

Waiting for process: com.sh1r0.caffe_android_demo
Client not ready yet.
Client not ready yet.
Connected to the target VM, address: 'localhost:8618', transport: 'socket'

When I commenting these few lines
static {
System.loadLibrary("caffe");
System.loadLibrary("caffe_jni");
}

at least for a short second the main window pops up, but after 1 second the screen turns black and the program freezes.
(In that case it runs until the lines:
caffeMobile.setNumThreads(4);

Could you tell me what is the exact combination of API and ANDROID_ABI that you tested this app on?

from caffe-android-lib.

sh1r0 avatar sh1r0 commented on August 17, 2024

@mgarbade
First, you should not to export ANDROID_ABI="arm64-v8a" if your device has a 32-bit ARMv7 processor.
Second, this project depends on android api 21 and I will not put extra efforts in supporting older versions than android 5 (#39).

from caffe-android-lib.

mgarbade avatar mgarbade commented on August 17, 2024

It works :-))))))) thank you so much!
I updated my Galaxy to 5.1.1 Lollipop and now I can run the app on it!
When using the Android device emulator the program also didn't crash anymore but also it could not load fully. Seems like the App needs too much hardware resources for the emulator to run it.

Besides the files mentioned I had also to push the 240MB Imagenet model to my phone using
adb push path/to/caffe-android-demo/caffe/models/bvlc_reference_caffenet/ bvlc_reference_caffenet.caffemodel /sdcard/caffe_mobile/bvlc_reference_caffenet/

from caffe-android-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.