caffe-android-lib icon indicating copy to clipboard operation
caffe-android-lib copied to clipboard

run `./bin/caffe train` through android adb

Open strin opened this issue 9 years ago • 6 comments

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.

strin avatar Jan 28 '16 21:01 strin

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.

sh1r0 avatar Jan 29 '16 01:01 sh1r0

I also got a segmentation fault when I run ./bin/caffe time -model lenet.prototxt

@strin @sh1r0 Have you found the solution?

elife33 avatar Nov 17 '16 08:11 elife33

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?

DevilGragon avatar Jan 19 '17 13:01 DevilGragon

@elife33 @DevilGragon Sorry, it's a known issue and I cannot find the root cause so far.

sh1r0 avatar Jan 20 '17 11:01 sh1r0

@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.

sh1r0 avatar Jan 20 '17 11:01 sh1r0

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.

zzzxxccvv avatar May 21 '17 13:05 zzzxxccvv