keras-segnet icon indicating copy to clipboard operation
keras-segnet copied to clipboard

ValueError: Error when checking input: expected conv2d_1_input to have shape (256, 256, 1) but got array with shape (1, 256, 256)

Open xyh-qz opened this issue 5 years ago • 3 comments

Thank you for sharing the code. I have been trying to apply your code a data set. However, running the code gives the following error message: exception_prefix='input') File "D:\Program Files\Python\Python35\lib\site-packages\keras\engine\training_utils.py", line 138, in standardize_input_data str(data_shape)) ValueError: Error when checking input: expected conv2d_1_input to have shape (256, 256, 1) but got array with shape (1, 256, 256)

xyh-qz avatar Jun 08 '19 06:06 xyh-qz

same error occured when I use this code

Any one give me the solution

kskeshab avatar Jul 08 '19 21:07 kskeshab

reshape the training data

train_data = train_data.reshape(6,256,256,1)

robelkebede avatar Feb 21 '20 12:02 robelkebede

Try setting data_format= channels_last

Roshni-Jhariya avatar Mar 07 '21 16:03 Roshni-Jhariya