I build mxnet from source on ubuntu 14.04+cuda8.0+cudnn5, and meet the following error when compiling. It seems like an opencv error, but I have installed opencv3.1 , how to solve it?
src/io/image_aug_default.cc: In member function ‘virtual cv::Mat mxnet::io::DefaultImageAugmenter::Process(const cv::Mat&, std::vector
, mxnet::common::RANDOM_ENGINE)’:
src/io/image_aug_default.cc:483:32: error: ‘CV_RGB2GRAY’ was not declared in this scope
cvtColor(res, temp_, CV_RGB2GRAY);
^
src/io/image_aug_default.cc:489:32: error: ‘CV_RGB2GRAY’ was not declared in this scope
cvtColor(res, temp_, CV_RGB2GRAY);
^
src/io/image_aug_default.cc:490:34: error: ‘CV_GRAY2BGR’ was not declared in this scope
cvtColor(temp_, temp_, CV_GRAY2BGR);
^
src/io/image_aug_default.cc:499:26: error: ‘CV_BGR2HLS’ was not declared in this scope
cvtColor(res, res, CV_BGR2HLS);
^
src/io/image_aug_default.cc:519:26: error: ‘CV_HLS2BGR’ was not declared in this scope
cvtColor(res, res, CV_HLS2BGR);
^
You can change the code in image_aug_default.cc.
CV_RGB2GRAY -------> cv::COLOR_RGB2GRAY
CV_GRAY2BGR -------> cv::COLOR_GRAY2BGR
CV_BGR2HLS -------> cv::COLOR_BGR2HLS
Hi @liangxi627 looks like this is an OpenCV Version issue. Currently MXNet CI is working on Ubuntu 16.04 version, please try this alternative if you cannot make it with the current solution.
@szha have you seen similar issues as this one before?
@mxnet-label-bot please add [build] in here
Hi, you can try do something like this:
1 image_augmenter.h
#if MXNET_USE_OPENCV
#include <opencv2/opencv.hpp>
+ #include <opencv2/imgproc/types_c.h>
#include // NOLINT()
#include // NOLINT()
#include // NOLINT(*)
2 image_io.cc
#if MXNET_USE_OPENCV
#include <opencv2/opencv.hpp>
+ #include <opencv2/imgproc/types_c.h>
#endif // MXNET_USE_OPENCV
@nuaawzl It works, thanks!
Most helpful comment
Hi, you can try do something like this:
1 image_augmenter.h
2 image_io.cc