How to build the caffe framework in armv7,armv7s,arm64 for iOS mobile apps ?

Visto 1.449 veces
Saltar al primer mensaje no leído

Manoj arun

no leída,
11 abr 2015, 3:40:3211/4/15
a caffe...@googlegroups.com
I am developing a demo iOS app using caffe libraries in Xcode 6.2. I have added libcaffe-d.dylib,libproto-d.a,caffe.pb.cc,caffe.pb.h,caffe_pb2.py files in my project directory.

While building the app i got the below architecture error:

ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Users/Macpro_ios_v2/Downloads/Caffe-Build-Version/lib/Debug/libcaffe-d.dylib' for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

While run Caffe master in xocde to generate libcaffe-d.dylib,libproto-d.a libraries ,xocde will automaticalliy selects “universal (32/64 bit intel) (x86_64,i386) - $(ARCHS_STANDRED_32_64_BIT) ” architecture by default.

Is there any ways to build the Caffe app in armv7 architure? any other frameworks are needs to be added to fix the above issues? How to change architecture preferences in Cmake file list ?

Detlef Schmicker

no leída,
11 abr 2015, 6:05:2011/4/15
a caffe...@googlegroups.com
My guess:

you should build libcaffe within xcode, and it should be possible to add the architectures, if you really imported the project. Otherwize you will need to import the source codes and manage the build settings yourself...

You must build libproto from source too!!! (it has also a bsd style licence, as far as I could see, which is important, otherwize you would have problems using it on iOS)

https://github.com/google/protobuf

Please post any success, I am very interested in this too. But I will probably need hardware acceleration and dreaming of opencl support in iOS 9 :)

Detlef

christophe Richard

no leída,
28 abr 2015, 4:41:0528/4/15
a caffe...@googlegroups.com
Hi, I'm struggling with the same problem, and got the same conclusion, we have to build the libcaffe on ARM, or by using a cmake configure for ARM or using Xcode. 
For the Xcode project look for some cocoapods, it seems we have already BOOST, EIGEN, even Protobuff on Pods, so "no need" to build them...

You also have a project using caffe-compact on github which is a small version removing the useless CUDA part for iOS devices.



karthik

no leída,
19 may 2015, 9:37:5519/5/15
a caffe...@googlegroups.com

Alejandro Isaza

no leída,
19 jun 2015, 12:17:5319/6/15
a caffe...@googlegroups.com,smano...@gmail.com
Check out my fork, it has an Xcode project that compiles for iOS and OS X: https://github.com/aleph7/caffe

Let me know if that works.

Matsuyama Takuya

no leída,
17 jul 2015, 20:54:3117/7/15
a caffe...@googlegroups.com,smano...@gmail.com
Check out my iOS example using aleph's work: https://github.com/noradaiko/caffe-ios-sample

Andre Luckow

no leída,
26 dic 2015, 22:46:5426/12/15
a Caffe Users,smano...@gmail.com
Hi Matsuyama,
thanks for sharing the link! I am running into some linker issues with OpenCV. I tried to compile/link your example against Github master and several OpenCV binary releases: 2.4.11, 3.0, 3.1.

"cv::split(cv::Mat const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >&)", referenced from:

Classifier::Preprocess(cv::Mat const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >*) in Classifier.o

"cv::merge(std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> > const&, cv::_OutputArray const&)", referenced from:

Classifier::SetMean(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Classifier.o

"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:

Classifier::SetMean(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Classifier.o

Classifier::Preprocess(cv::Mat const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >*) in Classifier.o

-[ViewController predictWithImage:] in ViewController.o

"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:

Classifier::SetMean(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Classifier.o

Classifier::Preprocess(cv::Mat const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >*) in Classifier.o

-[ViewController predictWithImage:] in ViewController.o


ld: symbol(s) not found for architecture arm64


Do you know which version should work?


Thanks for your help!


Best,

Andre

Matsuyama Takuya

no leída,
26 dic 2015, 23:32:5726/12/15
a Caffe Users,smano...@gmail.com
OpenCV 2.4.11 should work.
Please check Link Binary with Libraries section of the project settings and the `opencv2.framework` is added as Required.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos