intel / caffe

This fork of BVLC/Caffe is dedicated to improving performance of this deep learning framework when running on CPU, in particular Intel® Xeon processors.
Other
849 stars 491 forks source link

Build intel-caffe with OpenCV4 #262

Open ZeweiChen11 opened 5 years ago

ZeweiChen11 commented 5 years ago

I followed https://github.com/intel/caffe/wiki/Build-Caffe-with-Intel--Compiler to build intel-caffe. Command line: CC=icc CXX=icpc CPATH="" make all -j$(nproc)

Error:

/root/caffe/src/caffe/layers/image_data_layer.cpp(122): error: identifier "CV_BGR2RGB" is undefined
      cv::cvtColor(cv_img, cv_img, CV_BGR2RGB);
                                   ^

/root/caffe/src/caffe/layers/image_data_layer.cpp(182): error: identifier "CV_BGR2RGB" is undefined
      cv::cvtColor(cv_img, cv_img, CV_BGR2RGB);
                                   ^

compilation aborted for /root/caffe/src/caffe/layers/image_data_layer.cpp (code 2)
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:700: src/caffe/CMakeFiles/caffe.dir/layers/image_data_layer.cpp.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:378: src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
ftian1 commented 5 years ago

we didn't formally claim we support opencv4. but as a workaround, you can change CV_BGR2RGB to COLOR_BGR2RGB and have a try.

ZeweiChen11 commented 5 years ago

Followed your suggestion but the same issue:

/root/caffe/src/caffe/layers/image_data_layer.cpp(122): error: identifier "COLOR_BGR2RGB" is undefined
      cv::cvtColor(cv_img, cv_img, COLOR_BGR2RGB);
                                   ^

/root/caffe/src/caffe/layers/image_data_layer.cpp(182): error: identifier "COLOR_BGR2RGB" is undefined
      cv::cvtColor(cv_img, cv_img, COLOR_BGR2RGB);
                                   ^

compilation aborted for /root/caffe/src/caffe/layers/image_data_layer.cpp (code 2)
ftian1 commented 5 years ago

how about cv::COLOR_BGR2RGB?