Issue
Here is my code ,
I tried to build below CNN network , this error i am observing ,
model.add(Conv2D(8,3,activation='relu',padding='same',input_shape=(180,180)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(16,3,activation='relu',padding='same',input_shape=(180,180)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32,3,activation='relu',padding='same',input_shape=(180,180)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(64,3,activation='relu',padding='same',input_shape=(180,180)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(128,3,activation='relu',padding='same',input_shape=(180,180)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(254, activation='relu'))
model.add(Dense(9, activation='softmax'))
The image_batch is a tensor of the shape (32, 180, 180, 3). This is a batch of 32 images of shape 180x180x3 (the last dimension refers to color channels RGB). The label_batch is a tensor of the shape (32,), these are corresponding labels to the 32 images
Solution
You need to configure the CNN to process the inputs of shape
model.add(layers.Conv2D(8, (3, 3), activation='relu', input_shape=(180, 180, 3)))
The first dimension is considered as the batch_size. If you specify input_shape=(180,180)
then it means that image_height=180, image_width=180
and the batch_size=None
that means arbitrary number of samples could be given as input during model fit stage.
Answered By - Priya
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.