1

1.I download source from https://github.com/aleph7/caffe/ and builded the caffe as static library for IOS and IPhone. 2.Created sample demo code and Linked Caffe static lib(.a) and execute the code. 3.Now I got Run time error

F0519 14:54:12.494139 14504 layer_factory.hpp:77] Check failed: registry.count(t ype) == 1 (0 vs. 1) Unknown layer type: Convolution (known types: MemoryData)

4.I searched a lot and found one solution from below link

Caffe layer creation failure

5.If I create dynamic library instead of static library. It will work.

6.I tried to convert static library into Dynamic library.I got Error on Xcode that is cannot open the project I referred below link.

How do I change an existing XCode target from dynamic to static?

Can you help how to solve this..?

Community
  • 1
  • 1
balajichinna
  • 413
  • 5
  • 17
  • Try also asking in Caffe Google's users group - https://groups.google.com/forum/#!forum/caffe-users – rkellerm Jul 13 '15 at 06:41

1 Answers1

-1

Caffe register layer classes through REGISTER_LAYER_CLASS macro. Some build tools (e.g. Xcode) will optimize some part of it out (a little complex to explain). You can add -Wl,-force_load path/to/libcaffe.a to the Other Linker Flags build option. It will force Xcode to load all the things in libcaffe.a to the final target.

And more, Unknown layer type error can also caused by stale code. The caffe code in https://github.com/aleph7/caffe/ is out of date. You can try my port at https://github.com/solrex/caffe-mobile. It inlcudes a demo iOS app, works with the newest build tool. The Caffe source is up to date and you can sync the latest caffe code your self.

solrex
  • 39
  • 4