2

I trained net using my own dataset via caffe, now I want to write a classification code using C++. My machine (linux) works with CPU only! (I train the net in VM with GPU's).

When I try to "include" specific Caffe header: #include <caffe/caffe.hpp> the compiler shows me this message: fatal error: caffe/caffe.hpp: No such file or directory.

I tried to copy specific caffe files to /usr/lib/ but it didn't help. Any suggestions?

Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
Z.Kal
  • 426
  • 4
  • 18
  • ***I tried to copy specific caffe files to /usr/lib/ but it didn't help.*** It should have been /usr/include since the problem is the include files.. Is there a caffe folder in /usr/include? – drescherjm Aug 25 '16 at 12:47

2 Answers2

2

Your problem has nothing with Caffe or Deep Learning. You have just missed the right way to include header files.

When you want to include a header file, it should either be in the same folder of the including file or you should write the correct folder. Some IDEs like MSVS (I think all others do too) gives the ability to determine a specific folder where the header file of another library are.

So, just make sure that you have tell the compiler where to find the including folder.

Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
  • first of all, thanks for answering. secondly, I know how to "Include files", the problem is running Caffe headers in IDE. it works perfectly on bash (linux shell). if you'll have another idea for solution please share with me. have a good day. – Z.Kal Aug 26 '16 at 18:40
  • what's the solution when you run this of Linux terminal using something like `$ g++ -Wall -o ssd_detect ssd_detect.cpp` ? – Mona Jalal Mar 15 '17 at 22:24
1

Shouldn't you just do #include <caffe.hpp> and make sure this file is found within one of the include-directories?

Robert Kock
  • 5,795
  • 1
  • 12
  • 20