0

making a model for image segmentation using keras in python but getting error at first layer which is Conv2D. In code this line is as:

model.add(Conv2D(32,kernel_size=(3, 3),padding='same',input_shape=(1,500,366,3)))

but getting following error:

ValueError: Input 0 is incompatible with layer conv2d_1: expected ndim=4, found ndim=5

I am making this model initially for one image.

1
  • PS: input_shape(samples=1,width=500,height=366,channels=3) Commented Mar 14, 2018 at 10:55

1 Answer 1

1

try removing your first dimension like this:

model.add(Conv2D(32,kernel_size=(3, 3),padding='same',input_shape=(500,366,3)))
Sign up to request clarification or add additional context in comments.

2 Comments

try model.add(Conv2D(32,kernel_size=(3, 3),padding='same',input_shape=(366,500,3)))
But when I am adding the line model.fit(data,output,batch_size,epochs) it gives error: ValueError: Error when checking target: expected max_pooling2d_1 to have shape (None, 183, 250, 32) but got array with shape (1, 366, 500, 3).....that is it's giving error on last layer ... ......Maybe error is somewhere else

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.