Looks like color_mode is ignore in the flow when Turbo JPEG decoder is used. Observed while training coco dataset which contains gray images.
See below,
https://github.com/NVIDIA/caffe/blob/caffe-0.17/src/caffe/util/io.cpp#L152
Inserting the following lines fixes the issue.
if(cv_img->channels()<3 && color_mode>0) {
cv::cvtColor(cv_img, cv_img, cv::COLOR_GRAY2BGR);
}
Looks like color_mode is ignore in the flow when Turbo JPEG decoder is used. Observed while training coco dataset which contains gray images. See below, https://github.com/NVIDIA/caffe/blob/caffe-0.17/src/caffe/util/io.cpp#L152 Inserting the following lines fixes the issue. if(cv_img->channels()<3 && color_mode>0) { cv::cvtColor(cv_img, cv_img, cv::COLOR_GRAY2BGR); }