# Input 0 is incompatible with layer conv1d_40: expected ndim=3, found ndim=2 [closed]

i am working on computer vision using deep learning. my training data contains (x,128) shape. i am passing the same to conv1d layer but facing issues

below is my model

input_dim = (128,)
classifier = Sequential()

#convolutional layer 1
classifier.add(Convolution1D(32, kernel_size=3,input_shape = input_dim, activation = 'relu'))

#convolutional layer 2

#flatten

• Look at this answer, this is probably the same issue here: stackoverflow.com/a/49841111/9858126 – Sean Mirchi Jul 15 '19 at 8:21
• @SeanMirchi i tried it. but still facing the same issue – Ashu Jul 15 '19 at 9:48

Conv1D requires (batch-size, steps, dim) inputs. Your input sounds like (batch-size, steps). I'm guessing you have 128 steps of some univariate series. If so your input_dim is (128, 1). Your input may need to be reshaped to add an extra dimension at the end to conform.

your shape should be (img_w, img_h, num_colour_channels)

• This is a 1D convolution. You are answering as if the input is a 2D image and performing a 2D convolution, which would require 4-dimensional tensors, not 3. – Sean Owen Nov 21 at 20:35