import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.utils import to_categorical
import numpy as np
x=[[[13.0, 10.0], [12.0, 28.0], [10.0, 14.0], [6.0, 53.0]], [[12.0, 53.0], [13.0, 53.0], [10.0, 53.0], [3.0, 31.44]], [[15.0, 28.0], [16.0, 28.0], [13.0, 28.0], [6.0, 28.0]]]
y=[0, 1, 2]
x=np.array(x).reshape(-1,4,2)
y=to_categorical(np.array(y),num_classes=3)
model = Sequential()
model.add(Dense(16, activation='relu',input_shape=(4,2)))
model.add(Dropout(0.5))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(3, activation='softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
model.fit(x, y, epochs=20)
выдает ошибку:
ValueError: Shapes (None, 3) and (None, 4, 3) are incompatible