Deep-Image-Analogy icon indicating copy to clipboard operation
Deep-Image-Analogy copied to clipboard

undefined reference to ‘‘caffe::Net<float>::Net(...)" while sh scripts/make_deep_image_analogy.sh

Open yunyunhello opened this issue 7 years ago • 1 comments

After I compiled caffe and tested it successfully, and then I followed the Configure & Build(Linux version). While I executing "sh scripts/config_deep_image_analogy.sh", the error prompt is like this:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). ./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

deep_image_analogy/source/lbfgs.cu:17:9: warning: #pragma once in main file #pragma once ^ deep_image_analogy/source/lbfgs.cu:17:9: warning: #pragma once in main file #pragma once ^ /tmp/tmpxft_00002e95_00000000-29_Classifier.o:在函数‘Classifier::Classifier(std::string const&, std::string const&)’中: Classifier.cpp:(.text+0xa8):对‘caffe::Net::Net(std::string const&, caffe::Phase, int, std::vector<std::string, std::allocatorstd::string > const*, caffe::Net const*)’未定义的引用 Classifier.cpp:(.text+0xe7):对‘caffe::Net::CopyTrainedLayersFrom(std::string)’未定义的引用 /tmp/tmpxft_00002e95_00000000-29_Classifier.o:在函数‘Classifier::Predict(cv::Mat const&, std::vector<std::string, std::allocatorstd::string >&, std::vector<float*, std::allocator<float*> >&, std::vector<float*, std::allocator<float*> >&, std::vector<Dim, std::allocator<Dim> >&)’中: Classifier.cpp:(.text+0x5bb):对‘caffe::Net::blob_by_name(std::string const&) const’未定义的引用 /tmp/tmpxft_00002e95_00000000-29_Classifier.o:在函数‘std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)’中: Classifier.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x7b):对‘google::base::CheckOpMessageBuilder::NewString()’未定义的引用 /tmp/tmpxft_00002e95_00000000-30_Deconv.o:在函数‘my_cost_function::f_gradf(float const*, float*, float*)’中: Deconv.cpp:(.text+0x7e):对‘caffe::Net::blob_by_name(std::string const&) const’未定义的引用 Deconv.cpp:(.text+0xc4):对‘caffe::Net::blob_by_name(std::string const&) const’未定义的引用 Deconv.cpp:(.text+0x1b2):对‘caffe::Net::blob_by_name(std::string const&) const’未定义的引用 collect2: error: ld returned 1 exit status

I am a green hand to caffe and this project, so how should I fix this error? Thanks a lot!

yunyunhello avatar Mar 17 '18 09:03 yunyunhello

I changed the version of my gcc and g++ from 4.9 to 5.0, and recompiled it successfully. But I don't know why.

yunyunhello avatar Mar 20 '18 02:03 yunyunhello