You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lei9wang Sorry, you cannot do that. The caffe source code in this project is modified, a lot. You can only add some self-defined layers, and fix the compiling errors yourself.
i replace caffe with myself caffe, then ./tools/build_android.sh
There is link error like this:
canning dependencies of target caffe
[ 57%] Linking CXX shared library ../../lib/libcaffe.so
[ 57%] Built target caffe
Scanning dependencies of target caffe-jni
[ 71%] Building CXX object src/jni/CMakeFiles/caffe-jni.dir/caffe_jni.cpp.o
[ 85%] Building CXX object src/jni/CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o
[100%] Linking CXX shared library ../../lib/libcaffe-jni.so
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::CPUTimer::CPUTimer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::CPUTimer::Start()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::Blob::mutable_cpu_data()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::Timer::~Timer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::Net::Forward(float*)'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::CPUTimer::Stop()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'vtable for caffe::CPUTimer'
/home/linux/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::CPUTimer::MilliSeconds()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::Blob::cpu_data() const'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'caffe::Timer::~Timer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::predictImage(unsigned char const*, int, std::vector<float, std::allocator > const&, std::vector<float, std::allocator >&): error: undefined reference to 'vtable for caffe::CPUTimer'
/home/linux/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::Caffe::Get()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::CPUTimer::CPUTimer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::CPUTimer::Start()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::Net::Net(std::string const&, caffe::Phase, int, std::vector<std::string, std::allocatorstd::string > const*)'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::Net::CopyTrainedLayersFrom(std::string)'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::CPUTimer::Stop()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::CPUTimer::MilliSeconds()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::Timer::~Timer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'vtable for caffe::CPUTimer'
/home/linux/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'caffe::Timer::~Timer()'
CMakeFiles/caffe-jni.dir/caffe_mobile.cpp.o:caffe_mobile.cpp:function caffe::CaffeMobile::CaffeMobile(std::string const&, std::string const&): error: undefined reference to 'vtable for caffe::CPUTimer'
/home/linux/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
collect2: error: ld returned 1 exit status
src/jni/CMakeFiles/caffe-jni.dir/build.make:124: recipe for target 'lib/libcaffe-jni.so' failed
make[2]: *** [lib/libcaffe-jni.so] Error 1
CMakeFiles/Makefile2:212: recipe for target 'src/jni/CMakeFiles/caffe-jni.dir/all' failed
make[1]: *** [src/jni/CMakeFiles/caffe-jni.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
if compile static library libcaffe-jni, it is okay.
@solrex , could you give guide about this issue?
The text was updated successfully, but these errors were encountered: