Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yunyunhello opened this issue Mar 17, 2018 · 1 comment

Comments

@yunyunhello
Copy link

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 >&)’中:
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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant