dgd_person_reid icon indicating copy to clipboard operation
dgd_person_reid copied to clipboard

Make caffe error

Open BeSlower opened this issue 8 years ago • 3 comments

At first time when I make caffe, everything is good. Today when I try to make it again ( I did make clean before make), it shows following error.

AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/device_query.bin
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX/LD -o .build_release/tools/convert_bboxset.bin
CXX/LD -o .build_release/tools/train_net.bin
CXX/LD -o .build_release/tools/finetune_net.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX/LD -o .build_release/tools/convert_labelset.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
.build_release/tools/convert_bboxset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > > >(__gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > >, __gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > >)':
convert_bboxset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIP8LineItemSt6vectorIS3_SaIS3_EEEEEEvT_S9_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIP8LineItemSt6vectorIS3_SaIS3_EEEEEEvT_S9_]+0x14): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/convert_bboxset.o: In function `main':
convert_bboxset.cpp:(.text.startup+0xb14): undefined reference to `caffe::ReadImageToDatumResizeShortSide(std::string const&, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
convert_bboxset.cpp:(.text.startup+0xe2e): undefined reference to `caffe::ReadImageToDatum(std::string const&, int, int, int, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_bboxset.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/tools/convert_imageset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > > >(__gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > >, __gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > >)':
convert_imageset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairISsiESt6vectorIS4_SaIS4_EEEEEEvT_SA_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairISsiESt6vectorIS4_SaIS4_EEEEEEvT_SA_]+0x14): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/convert_imageset.o: In function `main':
convert_imageset.cpp:(.text.startup+0x7ff): undefined reference to `caffe::ReadImageToDatumResizeShortSide(std::string const&, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
convert_imageset.cpp:(.text.startup+0xc98): undefined reference to `caffe::ReadImageToDatum(std::string const&, int, int, int, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1
.build_release/tools/extract_features.o: In function `caffe::Caffe::Get()':
extract_features.cpp:(.text._ZN5caffe5Caffe3GetEv[_ZN5caffe5Caffe3GetEv]+0x7): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/extract_features.o: In function `int feature_extraction_pipeline<float>(int, char**)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xcd): undefined reference to `caffe::Caffe::singleton_'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x148): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
.build_release/tools/convert_labelset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >)':
convert_labelset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEEvT_S8_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEEvT_S8_]+0x17): undefined reference to `caffe::Caffe::singleton_'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_labelset.bin] Error 1
.build_release/tools/caffe.o: In function `test()':
caffe.cpp:(.text+0xa6d): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
.build_release/tools/caffe.o: In function `time()':
caffe.cpp:(.text+0x1b6b): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
caffe.cpp:(.text+0x1c9e): undefined reference to `caffe::Net<float>::Backward(int)'
.build_release/tools/caffe.o: In function `caffe::Caffe::Get()':
caffe.cpp:(.text._ZN5caffe5Caffe3GetEv[_ZN5caffe5Caffe3GetEv]+0x7): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/caffe.o: In function `main':
caffe.cpp:(.text.startup+0x80): undefined reference to `caffe::GlobalFinalize()'
caffe.cpp:(.text.startup+0xea): undefined reference to `caffe::GlobalFinalize()'
.build_release/tools/caffe.o: In function `caffe::Solver<float>* caffe::GetSolver<float>(caffe::SolverParameter const&)':
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x3f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x14f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x1ff): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x297): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x33f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1

I cannot figure out the reason. Could you give me some suggestions? Thanks.

BeSlower avatar Jun 16 '16 09:06 BeSlower

It seems that some implementations cannot be found. For example, caffe::GlobalFinalize() should be implemented in src/caffe/common.cpp at here. Could you please check if this file is exactly the same as yours?

Cysu avatar Jun 19 '16 07:06 Cysu

I checked src/caffe/common.cpp. It is exactly same as yours. Since I use git clone from yours, it shouldn't be different at all.

BeSlower avatar Jun 20 '16 01:06 BeSlower

Hi there, I just came across this issue a few days ago. In my case, it is introduced by the libcaffe.so libcaffe.a linking error. This is because my server has been installed another version of caffe in the library path. And the Makefile finds the package from the system library path first and then the build library path.

You may try whether the change of the Makefile as below to solve the problem.

change the: LIBRARY_DIRS += $(LIB_BUILD_DIR) to: LIBRARY_DIRS := $(LIB_BUILD_DIR) + $(LIBRARY_DIRS)

Hope it helps.

csgcmai avatar Jun 05 '17 02:06 csgcmai