Image-Classification-by-Keras-and-Tensorflow
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,)
ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (6,)
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.
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.