How can we use yolov2 for gray scale images? I tried to change the number of channels from 3 to 1, but after starting the training for sometime, it shows segmentation fault. Please tell me in detail.. how could i resolve this issue. I have used tiny-yolo as my model. @pjreddie @lilohuang
You may give a try using d.X.cols = h*w; instead of d.X.cols = h*w*3; on src/data.c#L953 and recompiling darknet if all input images are gray-scale image for training. Need an elegant fix to this.
// https://github.com/pjreddie/darknet/blob/master/src/data.c#L944
data load_data_detection(int n, char **paths, int m, int w, int h, int boxes, int classes, float jitter, float hue, float saturation, float exposure)
{
char **random_paths = get_random_paths(paths, n, m);
int i;
data d = {0};
d.shallow = 0;
d.X.rows = n;
d.X.vals = calloc(d.X.rows, sizeof(float*));
d.X.cols = h*w; // d.X.cols = h*w*3;
@lilohuang Thanks it Worked....
@sayanmutd : Is the performance using grey images is similar when compared to color images?
Most helpful comment
You may give a try using
d.X.cols = h*w;instead ofd.X.cols = h*w*3;on src/data.c#L953 and recompiling darknet if all input images are gray-scale image for training. Need an elegant fix to this.