CNN分类输入形状

时间:2020-03-24 21:52:54

标签: classification cnn

火车形状为:(985039,8),重塑后为:(985039,1,8) 我的代码是:

model = Sequential()
model.add(Conv2D(filters = 32, kernel_size = (5,5),padding = 'Same', activation ='relu', input_shape = (train_X.shape[0], train_X.shape[2], 1)))
model.compile(optimizer='adam', loss=['binary_crossentropy'], metrics=['accuracy'])
history = model.fit(train_X, y_train, epochs=7, batch_size=72, validation_data=(test_X, y_test))   

现在错误是:

ValueError:检查输入时出错:预期conv2d_38_input具有4维,但数组的形状为(985039,1,8)

我以不同的方式更改了input_shape,但未解决。 谁能解决?

0 个答案:

没有答案