Giter Site home page Giter Site logo

solrex / caffe-mobile Goto Github PK

View Code? Open in Web Editor NEW
317.0 26.0 122.0 701 KB

Optimized (for size and speed) Caffe lib for iOS and Android with out-of-the-box demo APP.

License: Other

CMake 5.24% C++ 93.90% Python 0.43% Shell 0.42%
caffe deep-learning android ios app cnn dnn mobile-app

caffe-mobile's Introduction

Caffe on Mobile Devices

Optimized (for size and speed) Caffe lib for iOS and Android with demo APP. (CPU_ONLY, NO_BACKWARD, NO_BOOST, NO_HDF5, NO_LEVELDB)

Screenshots

iPhone5s Meizu M3 note

NOTE: Cmake version 3.7.2 builds faster lib than version 3.5.1 (verified on Ubuntu 16.10/Android NDK r14). Don't know why. So please use a newer cmake if you can.

NOTE: NDK version r16+ is not supported. NDK r16 moves all standalone headers to unified headers. It causes a lot of cross compile problems which I cannot resolve. See issue #52.

For iPhone or iPhone Simulator

Step 1: Build Caffe-Mobile Lib with cmake

$ git clone --recursive https://github.com/solrex/caffe-mobile.git
$ ./tools/build_ios.sh

Step 2: Build iOS App: CaffeSimple with Xcode

  • For CaffeSimple to run, you need a pre-trained LeNet on MNIST caffe model and the weight file. Follow the instructions in Training LeNet on MNIST with Caffe to train your LeNet Model on MNIST. Then copy the the trained weight file caffe/examples/mnist/lenet_iter_10000.caffemodel to CaffeSimple app directory. Note: Check the batch size setting in net.prototxt, set it to 1 if needed.
$ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel \
     $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/weight.caffemodel
  • If you want to use your self-defined caffe network, use tools/prototxt2bin.py net.prototxt to convert your prototxt to protobin. Then place net.protobin in $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/.

  • Load the Xcode project inside the $CAFFE_MOBILE/examples/ios/simple/ folder, connect your iPhone to Mac, change target to "Your Name's iPhone", and press Command-R to build and run it on your connected device.

For Android

Step 1: Build Caffe-Mobile Lib with cmake

Test passed ANDROID_ABI:

  • arm64-v8a
  • armeabi
  • armeabi-v7a with NEON (not stable)
$ git clone --recursive https://github.com/solrex/caffe-mobile.git
$ export NDK_HOME=/path/to/your/ndk  # C:/path/to/your/ndk on MinGW64 (/c/path/to/your/ndk not work for OpenBLAS)
$ ./tools/build_android.sh

For Windows Users:

Install the following softwares before you start:

  1. Git for Windows: A shell environment(MinGW64) to run the build.
  2. tdm64-gcc-5.1.0-2.exe: The GNU toolchain, remember to copy /path/to/TDM-GCC-64/bin/mingw32-make.exe to /path/to/TDM-GCC-64/bin/make.exe.
  3. cmake-3.8.2-win64-x64.msi: Cmake

Then start Git Bash application to run the build script.

Step 2: Build Android App: CaffeSimple with Android Studio

  • For CaffeSimple to run, you need a pre-trained LeNet on MNIST caffe model and the weight file. Follow the instructions in Training LeNet on MNIST with Caffe to train your LeNet Model on MNIST. Then copy the model file caffe/examples/mnist/lenet.prototxt and the trained weight file caffe/examples/mnist/lenet_iter_10000.caffemodel to the SD card root of your Android mobile phone. Check the batch size setting in net.prototxt, set it to 1 if needed.
$ adb push $CAFFE/examples/mnist/lenet_iter_10000.caffemodel \
     /sdcard/weight.caffemodel
$ adb push $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/net.protobin \
     /sdcard/net.protobin
$ adb push $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/test_image.jpg \
     /sdcard/test_image.jpg
  • If you want to use your self-defined caffe network, use tools/prototxt2bin.py net.prototxt to convert your prototxt to protobin. Then push net.protobin to your sdcard root directory.

  • Load the Android studio project inside the $CAFFE_MOBILE/examples/android/CaffeSimple/ folder, and press Command-R to build and run it on your connected device.

For MacOSX & Ubuntu

Step 1: Install dependency

$ brew install protobuf # MacOSX
$ sudo apt install libprotobuf-dev protobuf-compiler libatlas-dev # Ubuntu

Step 2: Build Caffe-Mobile Lib with cmake

$ git clone --recursive https://github.com/solrex/caffe-mobile.git
$ mkdir build
$ cd ../build
$ cmake ..
$ make -j 4

Step 3: Build Caffe-bin with cmake

$ brew install gflags
$ cmake .. -DTOOLS
$ make -j 4

Thanks

caffe-mobile's People

Contributors

solrex avatar zchrissirhcz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe-mobile's Issues

Could not find toolchain file

Hi~ @solrex,

when I run ./tools/build_android.sh, it occurs this error. where is android.toolchain.cmake file?

CMake Error at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (message):
Could not find toolchain file:
../third_party/android-cmake/android.toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt

predict问题

为何用我自己的模型使用predict(byte[] bitmap, int channels, float[]mean)方法提到的特征和在PC上提到的特征差很多?

可以运行FCN吗

Hi 博主好,感谢提供demo,想请教一个问题,就是基于你这个框架,可以移植跑FCN吗?

Use hunter package manager for CMake dependencies

Hi,

Hope you are all well !

Just wanted to shared a couple of suggestions to bundle your caffe-mobile project for cross-platform compilation:

- CMake related

  • Hunter packages manager (already hunterized packages link) for CMake driven projects
    • Hunterized Caffe example: link
  • Polly (Cross-platform toolchains): link

- Camera Pipeline related

- Deep Learning for Mobile related

I was thinking to extend Yarrar project, as it is Unity3D ready, in order to create pluggable modules for processing any camera's frame but mixing instance or category matching tasks, even maybe facial landmark detection with dlib or dest. For that, nanomsg or nng sounds like to most optimal way to manage the input flow from the camera with out memory leaks.

I am really interested by your point of view about such bundling of caffe or mixed image recognition frameworks on mobile devices :-)

Have a great day !

Cheers,
Richard

"./build-protobuf-3.1.0.sh iPhoneOS" compile with error "No iOS SDK's found in default search path . Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK."

error log:
CMake Error at /Users/zhaoxiangyu/Documents/caffe-mobile/third_party/ios-cmake/toolchain/iOS.cmake:143 (message):
No iOS SDK's found in default search path . Manually set
CMAKE_IOS_SDK_ROOT or install the iOS SDK.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/CMakeDetermineSystem.cmake:85 (include)
CMakeLists.txt:12 (project)
pls tell me how to fix it! thx!

能集成opencv么?

楼主,能一起集成下opencv么?非常感谢,刚学这一块,实在不知道怎么交叉编译opencv相关部分

prototxt

1, this project don't support net.prototxt?

2,[use tools/prototxt2bin.py net.prototxt to convert your prototxt to protobin]
but this project not make for python

tools/prototxt2bin.py

tools/prototxt2bin.py
ImportError: No module named caffe.proto

cafffe的prototxt 不能直接跑吗

读Resnet.prototxt错误

你好,请教一个问题。我在读Resnet.prototxt时发生了错误。我编的是arm-v7a的so,另外采用新版本的工具转换成binayproto也没有成功。目前读cifar10.prototxt可以,但是读resnet不行。在pc上读同样的模型都没有问题,只要放在android上就不行。请问这是什么原因?

错误定位:
net_.reset(new Net(param_file, caffe::TEST));
这一句跑不过。
进net构造函数中,定位到是最后一个函数Init(param);中crash。目前暂未找到问题在哪。

Flasback after loading CaffeSample on Android phone

Everything is fine with the android build step. And I changed the batch size setting in net.prototxt before push it to sdcard. But when run app on the android phone, it always flashback to the home page. Do I missed any point?

how can we add GPU support with Metal ?

Hi @solrex

Thanks for creating this repo, It works for iOS, it looks great and promising.
The example codes takes 5 seconds to recognize a 28x28 number picture on my iPhone 6s.
I really want to see how I can help to use GPU to speed it up.
There is an old repo by integrating Metal framework DeepLearningKit. but it uses swift, I am afraid the rewrite them to OC/C++ make take a pretty long time.

Let me know if you are working on it or how can I help.

Apple Mach-O Linker(Id) Error

apple Mach-O Linker(Id) Error
caffe::Timer::~Timer() referenced from
caffe::CPUTimer::Start() reference from
caffe::Net::Net(std::_1::basic_string<char,std::_1::char_traits>...)

the libcaffe.a and libproto.a have been getted in build/lib

定制版caffe

您好,我想利用您现成的库添加一些层实现自己的caffe算法,请问我都要改哪些东西呢?万分感谢!

caffe::Net<float> *_net cann't use "Reshape()" method

hi @solrex ,it's me!
When I use the example of iOS,I try to use _net to call "Reshape()",it will be error with logs:
Undefined symbols for architecture arm64:
"caffe::Net::Reshape()", referenced from:
-[ViewController RunCaffeModel:] in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know how to fix it. Maybe libcaffe.a not contain net.cpp?
May you share how to build caffe for iOS?

windows上能移植吗

windows上能移植吗,官方的caffe在windows上依赖一堆的库,用你这个好像就依赖很少哦,能移植到windows上吗

能提供下net.protobin的原文件net.prototxt

首先 非常感谢您共享如此杰出的代码.
如果可以的话 可否提供下net.protobin的原文件net.prototxt 作为参考修改的模版 因为我不太了解文件的输入数据层和网络输出层的配置写法
非常感谢!

fatal error when run into 'android' phone

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.yangwenbo.caffesimple, PID: 12112
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yangwenbo.caffesimple-2/base.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.yangwenbo.caffesimple-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.yangwenbo.caffesimple-2/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]] couldn't find "libcaffe-jni.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:989)
at java.lang.System.loadLibrary(System.java:1533)
at com.yangwenbo.caffesimple.MainActivity.(MainActivity.java:116)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1083)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2682)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:199)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

NDK_HOME

I want recurrent this project,meet a basic problem about NDK_HOME
I have set $NDK_HOME in ./bashrc file,and test $NDK_HOME/ndk_build is ok!
but yet have error:

:###########################################################
ERROR: Invalid NDK_HOME="" env variable, exit.
###########################################################

my NDK is loaded from government website, https://developer.android.google.cn/ndk/downloads/index.html
how about solve this error?

Thanks

编译完成后在Android上加载模型出现以下错误,请问是什么情况?

01-05 14:30:56.275 21070-21070/com.meiya.sy.caffedemo D/MainActivity: onCreate: modelFile:/storage/emulated/0/descriptor
01-05 14:30:56.275 21070-21070/com.meiya.sy.caffedemo D/MainActivity: onCreate: weightFIle:/storage/emulated/0/sexy20171208_iter_1110.caffemodel
01-05 14:30:57.607 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/util/upgrade_proto.cpp:77] Attempting to upgrade batch norm layers using deprecated params: /storage/emulated/0/sexy20171208_iter_1110.caffemodel
01-05 14:30:57.608 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/util/upgrade_proto.cpp:80] Successfully upgraded batch norm layers using deprecated params.
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer data
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1a
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1a_bn
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1a_scale
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu1a
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1b
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1b_bn
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv1b_scale
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu1b
01-05 14:30:57.609 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool1b
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool1b_pool1b_0_split
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_1
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_1_bn
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_1_scale
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu2_1
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_2_bn
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_2_scale
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu2_2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res2_2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_bn
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv2_scale
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool2
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool2_pool2_0_split
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_1
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_1_bn
01-05 14:30:57.610 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_1_scale
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu3_1
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_2
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_2_bn
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_2_scale
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu3_2
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res3_2
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res3_2_res3_2_0_split
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_3
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_3_bn
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_3_scale
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu3_3
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_4
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_4_bn
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_4_scale
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu3_4
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res3_4
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_bn
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv3_scale
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu3
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool3
01-05 14:30:57.611 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool3_pool3_0_split
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_1
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_1_bn
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_1_scale
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_1
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_2
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_2_bn
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_2_scale
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_2
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_2
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_2_res4_2_0_split
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_3
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_3_bn
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_3_scale
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_3
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_4
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_4_bn
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_4_scale
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_4
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_4
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_4_res4_4_0_split
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_5
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_5_bn
01-05 14:30:57.612 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_5_scale
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_5
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_6
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_6_bn
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_6_scale
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_6
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_6
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_6_res4_6_0_split
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_7
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_7_bn
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_7_scale
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_7
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_8
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_8_bn
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_8_scale
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_8
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_8
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_8_res4_8_0_split
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_9
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_9_bn
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_9_scale
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_9
01-05 14:30:57.613 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_10
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_10_bn
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_10_scale
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4_10
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res4_10
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_bn
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv4_scale
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu4
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool4
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer pool4_pool4_0_split
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_1
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_1_bn
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_1_scale
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_1
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_2
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_2_bn
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_2_scale
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_2
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res5_2
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res5_2_res5_2_0_split
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_3
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_3_bn
01-05 14:30:57.614 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_3_scale
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_3
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_4
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_4_bn
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_4_scale
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_4
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res5_4
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res5_4_res5_4_0_split
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_5
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_5_bn
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_5_scale
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_5
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_6
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_6_bn
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer conv5_6_scale
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer relu5_6
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer res5_6
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer fc6
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer fc6_bn
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer fc6_scale
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer fc6_fc6_scale_0_split
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer sample_triplet
01-05 14:30:57.615 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer triplet_loss
01-05 14:30:57.616 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer L2length
01-05 14:30:57.616 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/caffe/net.cpp:765] Ignoring source layer mean_length
01-05 14:30:57.638 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/jni/caffe_mobile.cpp:34] Load (/storage/emulated/0/descriptor,/storage/emulated/0/sexy20171208_iter_1110.caffemodel), time:1359.55 ms.
01-05 14:30:57.639 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/jni/caffe_mobile.cpp:37] num_input:0
01-05 14:30:57.639 21070-21070/com.meiya.sy.caffedemo I/caffe: INFO /home/liaolp/caffe-mobile/src/jni/caffe_mobile.cpp:38] num_output:0
01-05 14:30:57.642 21070-21070/com.meiya.sy.caffedemo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 21070 (ya.sy.caffedemo)

                                                          [ 01-05 14:30:57.643   407:  407 W/         ]
                                                          debuggerd: handling request: pid=21070 uid=10392 gid=10392 tid=21070

ubantu 引用库运行加载prototxt报错

你好,加载prototxt总是报错,用标准的caffe运行是正常的,prototxt是正确的,麻烦看下是什么问题?
通过打印加载文件走的流程是ReadNetParamsFromBinaryFileOrDie,这个里面报错的。
Net ReadNetParamsFromBinaryFileOrDie
ERROR /home/huang/lcnn/Clust/caffe-mobile/src/caffe/util/upgrade_proto.cpp:97] ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: ../Models/cppnet.prototxt
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer hdf5_train_data
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer conv1
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer pool1
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer conv2
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer pool2
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer conv3
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer pool3
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer conv4
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer fc1
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer relu1
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer fc2
INFO /home/huang/lcnn/Clust/caffe-mobile/src/caffe/net.cpp:768] Ignoring source layer loss
Net ReadNetParamsFromBinaryFileOrDie
ERROR /home/huang/lcnn/Clust/caffe-mobile/src/caffe/util/upgrade_proto.cpp:97] ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: ../Models/deeplandmark/1_F.prototxt

import caffe failed

when I use prototxt2bin.py, get the error message
image

Do I have to install Caffe first?

What's the difference between yours “libcaffe-jni.so” and sh1r0/caffe-android-lib?

I have trained a cascade face detection model and load it on my Android device. First time I use the library of sh1r0/caffe-android-lib, but it work not well. Actually, it became more and more slowly in real time, the FPS drops from 12 to 1 or even more.Then i try to use yours library and the problem solve! I'm sure there is no errors in my codes. Can you indicate the approximate reason?

内存问题

初始化一个CaffeMobile实例进行提特征时内存占用大概250MB左右,为了提高效率初始化两个CaffeMobile实例在两个子线程中同时提取两张图片特征时,内存瞬间飙到好几个G,小米MIX2有6G多可用内存都直接崩溃掉,请问是什么情况?

Could not find PROTOBUF Compiler on MacOS Sierra 10.12

Hi, @solrex
I want to run the Demo on iPhone Simulator, But when I do it
cmake .. -DCMAKE_TOOLCHAIN_FILE=../third_party/ios-cmake/toolchain/iOS.cmake -DIOS_PLATFORM=SIMULATOR -DTHIRD_PARTY=1

I get this error:

CMake Warning (dev) at third_party/ios-cmake/toolchain/iOS.cmake:155 (elseif):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "SIMULATOR" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  build/CMakeFiles/3.8.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at /usr/local/Cellar/cmake/3.8.2/share/cmake/Modules/FindProtobuf.cmake:387 (message):
  Protobuf compiler version doesn't match library version 3.1.0
Call Stack (most recent call first):
  cmake/ProtoBuf.cmake:4 (find_package)
  CMakeLists.txt:41 (include)


CMake Error at cmake/ProtoBuf.cmake:13 (message):
  Could not find PROTOBUF Compiler
Call Stack (most recent call first):
  CMakeLists.txt:41 (include)


-- Configuring incomplete, errors occurred!
See also "/Users/mambaxie/Desktop/DeapLeaning/caffe-mobile/build/CMakeFiles/CMakeOutput.log".

How can I fix it?

error: thread-local storage is not supported for the current target

-- Build files have been written to: /Users/nitinjindal/Desktop/mobilecaffe/caffe-mobile/build_iPhoneSimulator
[ 1%] Running C++/Python protocol buffer compiler on /Users/nitinjindal/Desktop/mobilecaffe/caffe-mobile/src/caffe/proto/caffe.proto
Scanning dependencies of target proto
[ 3%] Building CXX object src/caffe/CMakeFiles/proto.dir///include/caffe/proto/caffe.pb.cc.o
[ 4%] Linking CXX static library ../../lib/libproto.a
[ 4%] Built target proto
Scanning dependencies of target caffe
[ 9%] Building CXX object src/caffe/CMakeFiles/caffe.dir/blob.cpp.o
[ 9%] Building CXX object src/caffe/CMakeFiles/caffe.dir/data_transformer.cpp.o
[ 9%] Building CXX object src/caffe/CMakeFiles/caffe.dir/common.cpp.o
[ 10%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layer_factory.cpp.o
/Users/nitinjindal/Desktop/mobilecaffe/caffe-mobile/src/caffe/common.cpp:24:1: error: thread-local storage is not supported for the current target
thread_local static Caffe *thread_instance_ = NULL;
^
1 error generated.
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/common.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

protocbuf.a is to large

非常感谢您提供demo,前几天在您的提示simulation和真机的区别下我做好的demo,本来以为ok啦,却发现由于protobuf生成的.a太大,想在工程的基础上,分理处初始化函数,分类函数,全局变量_net,生成动态链接库,不知道是否可以,谢谢

ios上编caffesimple的项目出现google::protobuf的错误

你好,在mac上可以编译通过,生成libcaffe.a 和libproto.a, 但是在ios上编你的caffesimple的项目的时候,使用你的Xcode配置,只不过把ios 系统从10.3降到9.3, 然后报一堆类似这样的错,我只粘了部分,希望您能解答一下
Undefined symbols for architecture arm64:
"google::protobuf::io::CodedInputStream::default_recursion_limit_", referenced from:
caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*) in libcaffe.a(io.cpp.o)
"google::protobuf::io::CodedInputStream::Refresh()", referenced from:
caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*) in libcaffe.a(io.cpp.o)
"typeinfo for google::protobuf::io::CopyingInputStream", referenced from:
typeinfo for caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*)::CopyingFileInputStream in libcaffe.a(io.cpp.o)
"google::protobuf::MessageLite::ParseFromCodedStream(google::protobuf::io::CodedInputStream*)", referenced from:
caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*) in libcaffe.a(io.cpp.o)
"google::protobuf::io::CodedInputStream::~CodedInputStream()", referenced from:
caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*) in libcaffe.a(io.cpp.o)
"google::protobuf::io::CopyingInputStream::Skip(int)", referenced from:
vtable for caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*)::CopyingFileInputStream in libcaffe.a(io.cpp.o)
"google::protobuf::MessageLite::InitializationErrorString() const", referenced from:
vtable for caffe::BlobShape in libproto.a(caffe.pb.cc.o)
vtable for caffe::BlobProto in libproto.a(caffe.pb.cc.o)
vtable for caffe::BlobProtoVector in libproto.a(caffe.pb.cc.o)
vtable for caffe::Datum in libproto.a(caffe.pb.cc.o)
vtable for caffe::FillerParameter in libproto.a(caffe.pb.cc.o)
vtable for caffe::NetParameter in libproto.a(caffe.pb.cc.o)
vtable for caffe::SolverParameter in libproto.a(caffe.pb.cc.o)
...
"google::protobuf::MessageLite::InternalSerializeWithCachedSizesToArray(bool, unsigned char*) const", referenced from:
vtable for caffe::BlobShape in libproto.a(caffe.pb.cc.o)
vtable for caffe::BlobProto in libproto.a(caffe.pb.cc.o)
vtable for caffe::BlobProtoVector in libproto.a(caffe.pb.cc.o)
vtable for caffe::Datum in libproto.a(caffe.pb.cc.o)
vtable for caffe::FillerParameter in libproto.a(caffe.pb.cc.o)
vtable for caffe::NetParameter in libproto.a(caffe.pb.cc.o)
vtable for caffe::SolverParameter in libproto.a(caffe.pb.cc.o)
...
"google::protobuf::internal::LogMessage::operator<<(char const*)", referenced from:
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libcaffe.a(blob.cpp.o)
...
"google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)", referenced from:
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libproto.a(caffe.pb.cc.o)
google::protobuf::RepeatedField::Reserve(int) in libcaffe.a(blob.cpp.o)

fatal error: glog/logging.h: No such file or directory

楼主你好--我这边新添加的一些层,头文件中用到了glog
我是mac的系统,这个问题网上说是没有安装glog,可是我已经安装了
通过brew install 和 conda install 都安装了 glog,可编译的时候还是报错,请问下有遇到过这种问题吗?

求助CMake Error

你好,使用./tools/build_android.sh时,出现错误
CMake Error: The source directory "/home/relaybot/android/caffe-mobile/third_party/protobuf-3.1.0/protobuf-3.1.0/cmake" does not exist.
该如何解呢?

incompatible target, collect2: error: ld return 1 exit status

Hi @solrex ,A problem has been bother me for a while. The target I use is Android. When I came to the last step to create libcaffe-jni.so, it told me that some of the openblas static link file are incompatible targets.What do you think I should do to fix this issue?Apart from cross compile chain reason, is there other reasons result in this problem?If it's cross compile chain problem, how could I make sure that the next configuration is correct?

Add new layer in caffe on iOS

Hi @solrex ,

Thank for you great work. I have a problem in runtime. I add a new layer and revise caffe.proto with parameters but the library can not recognize these parameters. I convert prototxt into protobin. How can you add a new layer?

Here is example:

Caffe.proto:
message NewLayerParameter {
optional uint32 num_classes = 1;
optional bool share_location = 2 [default = true];
}

prototxt:
layer {
name: "out"
type: "NewLayer"
bottom: "data"
top: "out"
include {
phase: TEST
}
output_param {
num_classes: 2
share_location: true
}
}

The program does not know num_classes = 2 and share_location = true.

Thanks.

楼主你好,载入模型出错,提示不支持,然后app直接挂掉

这是我app运行的log,不太明白是什么意思,忘楼主指导指导

12-01 11:41:05.717 6028-6058/com.yangwenbo.caffesimple D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
12-01 11:41:08.875 6028-6028/com.yangwenbo.caffesimple I/PlaceActivity: init caffe.....
12-01 11:41:08.903 6028-6028/com.yangwenbo.caffesimple I/PlaceActivity: onCreate: modelFile:/storage/emulated/0/caffe/shufflenet_deploy_80.protobin
12-01 11:41:08.903 6028-6028/com.yangwenbo.caffesimple I/PlaceActivity: onCreate: weightFile:/storage/emulated/0/caffe/shuffleNet_80_4_iter_12000.caffemodel
12-01 11:41:08.911 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/util/upgrade_proto.cpp:67] Attempting to upgrade input file specified using deprecated input fields: /storage/emulated/0/caffe/shufflenet_deploy_80.protobin
12-01 11:41:08.912 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/util/upgrade_proto.cpp:70] Successfully upgraded file specified using deprecated input fields.
12-01 11:41:08.912 6028-6028/com.yangwenbo.caffesimple I/caffe: WARNING /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/util/upgrade_proto.cpp:72] Note that future Caffe releases will only support input layers and not input fields.
12-01 11:41:08.912 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/util/upgrade_proto.cpp:77] Attempting to upgrade batch norm layers using deprecated params: /storage/emulated/0/caffe/shufflenet_deploy_80.protobin
12-01 11:41:08.912 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/util/upgrade_proto.cpp:80] Successfully upgraded batch norm layers using deprecated params.
12-01 11:41:08.916 6028-6040/com.yangwenbo.caffesimple W/art: Suspending all threads took: 7.877ms
12-01 11:41:08.927 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer input
12-01 11:41:08.928 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] input -> data
12-01 11:41:08.928 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer conv1
12-01 11:41:08.928 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] conv1 -> conv1
12-01 11:41:08.930 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer conv1_bn
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer conv1_scale
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer conv1_scale
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer conv1_relu
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer pool1
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] pool1 -> pool1
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer pool1_pool1_0_split
12-01 11:41:08.931 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] pool1_pool1_0_split -> pool1_pool1_0_split_0
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] pool1_pool1_0_split -> pool1_pool1_0_split_1
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_match_conv
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] resx1_match_conv -> resx1_match_conv
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv1
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/src/caffe/net.cpp:394] resx1_conv1 -> resx1_conv1
12-01 11:41:08.932 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv1_bn
12-01 11:41:08.933 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv1_scale
12-01 11:41:08.933 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv1_scale
12-01 11:41:08.933 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv1_relu
12-01 11:41:08.933 6028-6028/com.yangwenbo.caffesimple I/caffe: INFO /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:77] Creating layer resx1_conv2
12-01 11:41:08.933 6028-6028/com.yangwenbo.caffesimple I/caffe: ERROR /Users/chenxingyi/work/machineLearning/code/caffe-mobile/include/caffe/layer_factory.hpp:81] (registry.count(type)) == (1) Unknown layer type: ConvolutionDepthwise (known types: AbsVal, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, Convolution, Crop, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, Exp, Filter, Flatten, Im2col, InnerProduct, Input, LRN, LSTM, Log, MVN, MemoryData, PReLU, Parameter, Pooling, Power, RNN, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, Silence, Slice, Softmax, Split, TanH, Threshold, Tile)
                                                                
                                                                --------- beginning of crash
12-01 11:41:08.934 6028-6028/com.yangwenbo.caffesimple A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6028 (nbo.caffesimple)
                                                               
                                                               [ 12-01 11:41:08.935  4064: 4064 W/         ]
                                                               debuggerd: handling request: pid=6028 uid=10044 gid=10044 tid=6028

Build Error on Mac

Hi,
Anyone had the same problem?
ERROR: "Could not find PROTOBUF Compiler"
Tried reinstall protobuf on Mac, not helping.
I don't have Caffe on my Mac, could this be the problem?

xcode compile errors

errors information is "ld: warning: ignoring file ../../../build/lib/libcaffe.a, missing required architecture i386 in file ../../../build/lib/libcaffe.a (3 slices)"
The library can not be loaded correct. Help please.

Runtime [ERROR] (registry.count(type)) == (1)Unknown layer type: Input (known types: )

Hi

I got a run-time error when using this as a static lib, and not compile as dynamic lib.
static_runtime.log.txt

I know this error may be related to linking settings, like this wiki said:
https://github.com/happynear/caffe-windows/blob/master/FAQ.md

Tried following steps:

  1. set: "Other Linker Flags" = "-Wl,-force_load,$(SRCROOT/lib/libcaffe.a", "Mach-O Type" = "Static Library", "Library Search Path"="$(SRCROOT/lib", "Link Binary with Libraries"="lib*.a" ---- no luck, still runtime error
  2. set: "Mach-O Type" = "Dynamic Library", got compile error "Undefined symbols for architecture arm64"
    dynamic_library_compile.log.txt

Thanks very much

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.