[英]Keras CNN error Input 0 of layer conv1d_13 is incompatible with the layer: : expected min_ndim=3, found ndim=2
I have dataset 9 columns.我有数据集 9 列。 Column 1-8 is feature, column 9 is class of dataset.
第 1-8 列是特征,第 9 列是数据集的类别。 I use CNN to classify like this code.
我使用 CNN 来分类这样的代码。
model = Sequential()
model.add(Conv1D(64, 2, activation="relu", input_shape=(8,1)))
model.add(Flatten())
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
model.fit(X, y, epochs=150, batch_size=10)
It show error like this.它显示这样的错误。
ValueError: Input 0 of layer conv1d_13 is incompatible with the layer: : expected min_ndim=3, found ndim=2. Full shape received: (None, 8)
How to fix it?如何解决?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.