captcha icon indicating copy to clipboard operation
captcha copied to clipboard

fit error help

Open redcatH opened this issue 5 years ago • 0 comments

model = Sequential()

model.add(Conv2D(32, kernel_size=(5, 9), activation='relu', input_shape=input_shape)) model.add(MaxPooling2D(pool_size=(2, 4)))

model.add(Conv2D(16, kernel_size=(5, 7), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 3)))

model.add(Flatten())

#num_classes*4 =104

model.add(Dense(num_classes*4, activation='sigmoid'))

model.compile(loss=keras.losses.binary_crossentropy, optimizer=keras.optimizers.Adadelta(), metrics=['accuracy'])

model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose=1, validation_data=(x_test, y_test))

ValueError: Error when checking target: expected dense_1 to have shape (104,) but got array with shape (26,)

why? help me~~~~thks~

redcatH avatar Dec 26 '19 16:12 redcatH