caffe
caffe copied to clipboard
Build intel-caffe with OpenCV4
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
we didn't formally claim we support opencv4. but as a workaround, you can change CV_BGR2RGB to COLOR_BGR2RGB and have a try.
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)
how about cv::COLOR_BGR2RGB?