Image-Classification-by-Keras-and-Tensorflow icon indicating copy to clipboard operation
Image-Classification-by-Keras-and-Tensorflow copied to clipboard

ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (6,)

Open smraghavDS opened this issue 6 years ago • 2 comments

ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (6,)

smraghavDS avatar Jan 29 '19 12:01 smraghavDS

The dimension of that Dense layer should be equal to the number of class labels you are using. 1 for binary class label and N for N class label.

sarathbaby avatar Mar 21 '19 18:03 sarathbaby

Please do also check the classes_num variable on line 40 and change it your needs. This may throw the error you mentioned as well.

zneha avatar Jun 20 '19 14:06 zneha