我的标签数组的形状为(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'])