나는 keras를 가진 nn를 train_on_batch
기능 훈련하는 것을 시도하고있다. 39 개 기능이 있고 32 개 샘플을 포함하는 배치가 필요합니다. 따라서 모든 교육 반복마다 32 개의 numpy 배열 목록이 있습니다. 그래서 여기훈련을위한 기능의 Keras 모양
내 코드입니다 (여기 모든 batch_x 32 NumPy와 배열의 목록이 각각 포함 39 개 기능입니다) :
input_shape = (39,)
model = Sequential()
model.add(Dense(39, input_shape=input_shape)) # show you is only first layer
...
for batch_x, batch_y in train_gen:
model.train_on_batch(batch_x, batch_y)
는하지만 갑자기 오류가있어 : 난
Exception: Error when checking model input: the list of Numpy arrays
that you are passing to your model is not the size the model expected.
Expected to see 1 arrays but instead got the following list of 32 arrays:
을 뭐가 잘못 됐는지 잘 모르겠다.
P. 나는 또한 (32, 39), (39, 32)와 같은 다른 input_shape
을 시도했다.