Running simple C++ programm using Caffe

85 views
Skip to first unread message

Иван Гунько

unread,
Sep 20, 2016, 10:45:32 AM9/20/16
to Caffe Users
Hey all,

I have some problem with running simple C++ program using Caffe. I lost much time with it, and don't see solution for this.

#include <iostream>
#include <caffe/caffe.hpp>
#include <memory>
using namespace std;
using namespace caffe;

int main(int argc, char** argv) {
    shared_ptr
<Net<float> > net_;
   
   
string file_name="it doesn't matter ";
   
    net_
.reset(new Net<float>(file_name, TEST));// or just: Net<float> caffe_test_net(file_name, TEST);
}

It's built without problem, but when I run program Error: symbol lookup error: /home/parrot/eclipse/workspace/Test_Caffe/Debug/Test_Caffe: undefined symbol: _ZN5caffe3NetIfEC1ERKSsNS_5PhaseEPKS1_

I noted that: problem appear when  I use in code caffe::TEST or caffe::TRAIN. I think there are some problem connected to: caffe::Phase. So I can't create caffe::Net<float> , becouse I can't use caffe::TEST.
I test other class\function, etc from caffe library and They didn't produce this Error.

I use IDE: Eclipse to built project. Some report from console:

make all
Building file: ../src/Test_Caffe.cpp
Invoking: Cross G++ Compiler
g++ -I"/home/smilart/0_Intall/1 caffe-rc3/include/" -I/usr/local/cuda-7.5/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Test_Caffe.d" -MT"src/Test_Caffe.o" -o "src/Test_Caffe.o" "../src/Test_Caffe.cpp"
Finished building: ../src/Test_Caffe.cpp
 
Building target: Test_Caffe
Invoking: Cross G++ Linker
g++ -L/usr/local/cuda/lib64/ -L"/home/smilart/0_Intall/1 caffe-rc3/build/lib/" -o "Test_Caffe"  ./src/Test_Caffe.o   -lboost_system -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lcudart -lcublas -lcurand -lboost_filesystem -lglog -lprotobuf -lcaffe
Finished building target: Test_Caffe
 

17:20:11 Build Finished (took 3s.277ms)


Reply all
Reply to author
Forward
0 new messages