Code Monkey home page Code Monkey logo

Comments (7)

LemonMi avatar LemonMi commented on July 23, 2024 1

@taneta Have you solved your problems now?And how do you solve it?I meet the same problem with you.Could you help me?Thank you!

from deep-image-analogy.

taneta avatar taneta commented on July 23, 2024

When I change the line:
-lcaffe \
in make_deep_image_analogy.sh to:
-L/opt/caffe/python \
it returns:

/tmp/tmpxft_000005d7_00000000-29_Classifier.o: In function `Classifier::Classifier(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Classifier.cpp:(.text+0xa8): undefined reference to `caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, caffe::Net<float> const*)'
Classifier.cpp:(.text+0xe1): undefined reference to `caffe::Net<float>::CopyTrainedLayersFrom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/tmpxft_000005d7_00000000-29_Classifier.o: In function `Classifier::Predict(cv::Mat const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::vector<float*, std::allocator<float*> >&, std::vector<float*, std::allocator<float*> >&, std::vector<Dim, std::allocator<Dim> >&)':
Classifier.cpp:(.text+0x50d): undefined reference to `caffe::Blob<float>::Reshape(int, int, int, int)'
Classifier.cpp:(.text+0x51f): undefined reference to `caffe::Net<float>::Reshape()'
Classifier.cpp:(.text+0x575): undefined reference to `caffe::Net<float>::Forward(float*)'
Classifier.cpp:(.text+0x5d3): undefined reference to `caffe::Net<float>::blob_by_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Classifier.cpp:(.text+0x6e1): undefined reference to `caffe::Blob<float>::gpu_data() const'
Classifier.cpp:(.text+0x741): undefined reference to `caffe::Blob<float>::mutable_gpu_data()'
/tmp/tmpxft_000005d7_00000000-29_Classifier.o: In function `Classifier::WrapInputLayer(std::vector<cv::Mat, std::allocator<cv::Mat> >*)':
Classifier.cpp:(.text+0x83f): undefined reference to `caffe::Blob<float>::mutable_cpu_data()'
/tmp/tmpxft_000005d7_00000000-29_Classifier.o: In function `Classifier::Preprocess(cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >*)':
Classifier.cpp:(.text+0xd2c): undefined reference to `caffe::Blob<float>::cpu_data() const'
/tmp/tmpxft_000005d7_00000000-29_Classifier.o: In function `caffe::Caffe::set_mode(caffe::Caffe::Brew)':
Classifier.cpp:(.text._ZN5caffe5Caffe8set_modeENS0_4BrewE[_ZN5caffe5Caffe8set_modeENS0_4BrewE]+0xc): undefined reference to `caffe::Caffe::Get()'
/tmp/tmpxft_000005d7_00000000-30_Deconv.o: In function `my_cost_function::f_gradf(float const*, float*, float*)':
Deconv.cpp:(.text+0x5c): undefined reference to `caffe::Net<float>::ForwardFromTo(int, int)'
Deconv.cpp:(.text+0x7e): undefined reference to `caffe::Net<float>::blob_by_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Deconv.cpp:(.text+0x92): undefined reference to `caffe::Blob<float>::gpu_data() const'
Deconv.cpp:(.text+0xc4): undefined reference to `caffe::Net<float>::blob_by_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Deconv.cpp:(.text+0xd8): undefined reference to `caffe::Blob<float>::mutable_gpu_diff()'
Deconv.cpp:(.text+0x106): undefined reference to `void caffe::caffe_gpu_sub<float>(int, float const*, float const*, float*)'
Deconv.cpp:(.text+0x140): undefined reference to `void caffe::caffe_gpu_mul<float>(int, float const*, float const*, float*)'
Deconv.cpp:(.text+0x159): undefined reference to `void caffe::caffe_gpu_asum<float>(int, float const*, float*)'
Deconv.cpp:(.text+0x17f): undefined reference to `caffe::Net<float>::BackwardFromTo(int, int)'
Deconv.cpp:(.text+0x1b2): undefined reference to `caffe::Net<float>::blob_by_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Deconv.cpp:(.text+0x1c6): undefined reference to `caffe::Blob<float>::gpu_diff() const'
/tmp/tmpxft_000005d7_00000000-30_Deconv.o: In function `deconv(Classifier*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, float*, Dim, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, float*, Dim)':
Deconv.cpp:(.text+0x803): undefined reference to `caffe::Net<float>::ForwardFromTo(int, int)'
/tmp/tmpxft_000005d7_00000000-30_Deconv.o: In function `caffe::Caffe::cublas_handle()':
Deconv.cpp:(.text._ZN5caffe5Caffe13cublas_handleEv[_ZN5caffe5Caffe13cublas_handleEv]+0x5): undefined reference to `caffe::Caffe::Get()'
/tmp/tmpxft_000005d7_00000000-41_DeepAnalogy.o: In function `norm(float*&, float*, float*, Dim)':
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x93): undefined reference to `void caffe::caffe_gpu_mul<float>(int, float const*, float const*, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0xf8): undefined reference to `void caffe::caffe_gpu_set<float>(int, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x139): undefined reference to `void caffe::caffe_gpu_gemv<float>(CBLAS_TRANSPOSE, int, int, float, float const*, float const*, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x18e): undefined reference to `void caffe::caffe_gpu_powx<float>(int, float const*, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x2ba): undefined reference to `void caffe::caffe_gpu_add_scalar<float>(int, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x2f6): undefined reference to `void caffe::caffe_gpu_scal<float>(int, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x343): undefined reference to `void caffe::caffe_gpu_gemm<float>(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, float const*, float, float*)'
tmpxft_000005d7_00000000-4_DeepAnalogy.cudafe1.cpp:(.text+0x360): undefined reference to `void caffe::caffe_gpu_div<float>(int, float const*, float const*, float*)'
collect2: error: ld returned 1 exit status

from deep-image-analogy.

zhengziqiang avatar zhengziqiang commented on July 23, 2024

ln -s /caffe/build/lib/libcaffe.so /usr/lib/libcaffe.so

It works for me

from deep-image-analogy.

tisawe avatar tisawe commented on July 23, 2024

@zhengziqiang
Linking the library failed to work for me. I no longer get the /usr/bin/ld: cannot find -lcaffe error message, but now this is returned:
/tmp/tmpxft_00001281_00000000-29_Classifier.o: In function `Classifier::Classifier(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': Classifier.cpp:(.text+0xa8): undefined reference to `caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, caffe::Net<float> const*)' collect2: error: ld returned 1 exit status

I do not know how to comprehend that. What I can tell you is that I did not make Caffe from the build provided in this repository since its an older build without compatibility for CUDNN > v5.1, rather I compiled Caffe from BVLC's master repository. Also, I do have a previous build of Deep Image Analogy, which runs successfully on this same machine, but it is from otrimegistro's fork (https://github.com/otrimegistro/Deep-Image-Analogy#deep-image-analogy) for Linux support. I also built Caffe from that fork when I only had CUDNN v5.1 installed, which is supported in that build of Caffe.

Are there dependencies for this project included in this repository that is not included in BVLS's master repository of Caffe?

from deep-image-analogy.

tisawe avatar tisawe commented on July 23, 2024

I successfully made the project by installing the master branch of Caffe and copying the specific files for this project into my directory of Caffe's master branch. Added '~/caffe/build/lib' to my 'LD_LIBRARY_PATH' and edited the scripts documented in the readme to work with my environment. Then I ran 'config_deep_image_analogy.sh' and 'make_deep_image_analogy.sh', and a working executable was made.

from deep-image-analogy.

brainstormapps avatar brainstormapps commented on July 23, 2024

Hi I have the same issue
I downloaded and compiled caffe successfully
No when I try to compile the project I got the following error
/usr/bin/ld: cannot find -lcaffe
as you mentioned LD_LIBRARY_PATH
my source path is /root/deeplearnng/Deep-Image-Analogy-linux
and my caffe path is /root/deeplearning/caffe-rc5/.build_release/lib
how can I set LD_LIBRARY_PATH
thanks and regards

from deep-image-analogy.

yunyunhello avatar yunyunhello commented on July 23, 2024

@tisawe
I tried your copy methods and build deep-image-analogy in the master branch of Caffe. However, I still got the same error as before.

/tmp/tmpxft_00005a96_00000000-29_Classifier.o:In function ‘Classifier::Classifier(std::string const&, std::string const&)’:
Classifier.cpp:(.text+0xa2):undefined reference to ‘caffe::Net::Net(std::string const&, caffe::Phase, int, std::vector<std::string, std::allocatorstd::string > const*)’
Classifier.cpp:(.text+0xe1):undefined reference to ‘caffe::Net::CopyTrainedLayersFrom(std::string)’
/tmp/tmpxft_00005a96_00000000-29_Classifier.o:In function ‘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+0x5b5):undefined reference to ‘caffe::Net::blob_by_name(std::string const&) const’
/tmp/tmpxft_00005a96_00000000-29_Classifier.o:In function ‘std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)’:
Classifier.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x7b):undefined reference to ‘google::base::CheckOpMessageBuilder::NewString()’
/tmp/tmpxft_00005a96_00000000-30_Deconv.o:In function ‘my_cost_function::f_gradf(float const*, float*, float*)’:
Deconv.cpp:(.text+0x7e):undefined reference to ‘caffe::Net::blob_by_name(std::string const&) const’
Deconv.cpp:(.text+0xc4):undefined reference to ‘caffe::Net::blob_by_name(std::string const&) const’
Deconv.cpp:(.text+0x1b2):undefined reference to ‘caffe::Net::blob_by_name(std::string const&) const’

Could you give me more suggestions or details about how you solved this problem?
Thanks a lot!

from deep-image-analogy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.