Skip to main content
formatting
Source Link
Itachi
  • 251
  • 2
  • 8

Can you give exact error, can't solve without that!!

There are 2 problems, the first your input shape should be input_tensor=Input(shape=(6, 1)) as it was throwing this error:

input 0 is incompatible with layer conv1d_31: expected ndim=3, found ndim=2

Solving this, I'm sensing problem with 3rd Conv1D, here it goes

Input has shape 6, and with padding = same, the output is 6 Second.

Second convolution has output of shape 2 by formula out_shape = (in_shape - kernel_size + 2*padding)/stride +1 (valid padding)

3rd convolution has kernel size 5 with input shape 2, that should give negative shape error. This is an impossible task mathematically. so either reduce the size of kernel or remove this layer. Also, you need to modify pooling layer as well, it will throw same error

Can you give exact error, can't solve without that!!

There are 2 problems, the first your input shape should be input_tensor=Input(shape=(6, 1)) as it was throwing this error:

input 0 is incompatible with layer conv1d_31: expected ndim=3, found ndim=2

Solving this, I'm sensing problem with 3rd Conv1D, here it goes

Input has shape 6, and with padding = same, the output is 6 Second convolution has output of shape 2 by formula out_shape = (in_shape - kernel_size + 2*padding)/stride +1 (valid padding)

3rd convolution has kernel size 5 with input shape 2, that should give negative shape error

Can you give exact error, can't solve without that!!

There are 2 problems, the first your input shape should be input_tensor=Input(shape=(6, 1)) as it was throwing this error:

input 0 is incompatible with layer conv1d_31: expected ndim=3, found ndim=2

Solving this, I'm sensing problem with 3rd Conv1D, here it goes

Input has shape 6, and with padding = same, the output is 6.

Second convolution has output of shape 2 by formula out_shape = (in_shape - kernel_size + 2*padding)/stride +1 (valid padding)

3rd convolution has kernel size 5 with input shape 2, that should give negative shape error. This is an impossible task mathematically. so either reduce the size of kernel or remove this layer. Also, you need to modify pooling layer as well, it will throw same error

Source Link
Itachi
  • 251
  • 2
  • 8

Can you give exact error, can't solve without that!!

There are 2 problems, the first your input shape should be input_tensor=Input(shape=(6, 1)) as it was throwing this error:

input 0 is incompatible with layer conv1d_31: expected ndim=3, found ndim=2

Solving this, I'm sensing problem with 3rd Conv1D, here it goes

Input has shape 6, and with padding = same, the output is 6 Second convolution has output of shape 2 by formula out_shape = (in_shape - kernel_size + 2*padding)/stride +1 (valid padding)

3rd convolution has kernel size 5 with input shape 2, that should give negative shape error