ケラスtrain_on_batch
とnnを訓練しようとしています。 39個の機能があり、32個のサンプルを含むバッチが必要です。だから私はトレーニングの繰り返しごとに32個のnumpyの配列を持っています。だからここトレーニングのための機能のケラス形
は私のコード(ここでは、すべての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.S.私はまた、(32,39)、(39,32)などの異なるinput_shape
を試しました。