I am a starter for the CNN DL. During CNN code I faced this error:
Negative dimension size caused by subtracting 3 from 1 for 'conv2d_3/convolution' (op: 'Conv2D') with input shapes: [?,19,1,64], [3,3,64,64]
My image data show 300(w)
, 855(h)
pixels size.
For the np array transformation, I applied below.
(width,height = 28)->>
img = cv2.resize(img, None, fx = img_width/img.shape[0], fy = img_height/img.shape[1])
x.append(img/256)
y.append(label)
And then, I tried CNN by using this:
model.add(Convolution2D(16,(3,3), border_mode='same', activation='relu', input_shape=x_train.shape[1:]))
x_train.shape[1:] = (80,10,3)
Please help to fix this error. Thank you for read.