Caffe: How to USE_OPENCV when include caffe.hpp in my own project?

Created on 18 Jul 2016  ·  5Comments  ·  Source: BVLC/caffe

Hi,
When I'm trying to create my own project in eclipse, I coppied the code from cpp_classification/classification.cpp. I dealed with many issues but I'm blocked at run it. It says "F0718 14:09:18.457209 5550 testcpp.cpp:282] This example requires OpenCV; compile with USE_OPENCV." when I tried to run it. Does anyone have sm idea about how to enable OpenCV in my own project?

Most helpful comment

You need to add some #define before including caffe.hpp, for instance:

#define USE_OPENCV 1
#define USE_CUDNN 1
#include <caffe/caffe.hpp>

All 5 comments

You need to add some #define before including caffe.hpp, for instance:

#define USE_OPENCV 1
#define USE_CUDNN 1
#include <caffe/caffe.hpp>

Please ask questions about usage/installation on the mailing list, thanks!

From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:

_Please do not post usage, installation, or modeling questions, or other requests for help to Issues._
Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

@flx42 Thank you!

@seanbell In China we have no access to google.

@flx42 Can it be done in Makefile somehow?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inferrna picture inferrna  ·  3Comments

kelvinxu picture kelvinxu  ·  3Comments

hawklucky picture hawklucky  ·  3Comments

malreddysid picture malreddysid  ·  3Comments

Ruhjkg picture Ruhjkg  ·  3Comments