caffe-android-lib
caffe-android-lib copied to clipboard
run `./bin/caffe train` through android adb
I compiled caffe-android-lib successfully for armeabi-v7a, and would like to train a model directly on phone.
Without hassling with UI, I decide to run caffe binary through adb shell. After having the root permission, I run
./bin/caffe train -solver examples/mnist/lenet_solver.prototxt
However, I got a segmentation fault.
Meanwhile, using libcaffe.so in Android app works perfectly.
I guess that you used some io lib format (say, lmdb in mnist example) as your data input which is not supported yet (please refer to this and this). BTW, root permission is not required to run executable in adb shell.
I also got a segmentation fault when I run ./bin/caffe time -model lenet.prototxt
@strin @sh1r0 Have you found the solution?
I also got this problem when I run ./caffe train --solver=lenet_solver.prototxt And I met some other problem. Before run this model, I compile caffe-android-lib on ubuntu 14.04 using ndk-r11c as required and compiled successfully with armeabi-v7a. But I try to run binary file, convert_mnist_data, on NanoPC T2, error message “This example requires LevelDB and LMDB; compile with USE_LEVELDB and USE_LMDB.” Thus I go to see conver_mnist_data.cpp, Makefile and Makefile.comfig. When I modified Makefile.config "USE_LEVELDB := 1 USE_LMDB := 1"to ensure that in convert_mnist_data.cpp we have defined USE_LEVELDB && USE_LMDB, but got the same result. @sh1r0 could you give me some advice?
@elife33 @DevilGragon Sorry, it's a known issue and I cannot find the root cause so far.
@DevilGragon You could do the conversion job on linux. By the way, I'm not sure if it's a good idea to train models on Android devices.
actually, it does not compile the src/solvers/*. so I think the train function will not work. While I am looking forward to make it work, for example the mnist train use the sgd_solver.cpp.