标签数组尺寸正确,但在检查目标时仍然出现错误

时间:2019-12-04 17:55:49

标签: python tensorflow keras

我的标签数组的形状为(5000, 10), 但仍然出现错误

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

这是我的网络模型:

model = Sequential()
model.add(Dense(16, input_shape=(3072, )))
model.add(Dense(16, activation='relu'))
model.add(Dense(10, activation='softmax'))
model.compile(loss='categorical_crossentropy',
              optimizer=Adam(),
              metrics=['accuracy'])

0 个答案:

没有答案