[英]ValueError: Input 0 of layer sequential_3 is incompatible with the layer:
[英]ValueError: Input 0 of layer "sequential_8" is incompatible with the layer - deep learning model
我正在尝试使用小型测试数据集设置我的第一个深度学习顺序 model。
不幸的是,当我调用 model.fit() 时收到以下错误消息:
ValueError: Input 0 of layer "sequential_8" is incompatible with the layer: expected shape=(None, 160, 4000), found shape=(32, 4000)
我的model如下
num_of_classes = 2
input_shape = (1,4000)
y_train_cat = keras.utils.to_categorical(y_train, num_of_classes)
y_test_cat = keras.utils.to_categorical(y_test, num_of_classes)
model = Sequential()
model.add(Conv1D(filters=10, kernel_size=5, input_shape=(160, 4000)))
model.add(MaxPool1D(pool_size=5))
model.add(Flatten())
model.add(Dense(1000, activation='relu'))
model.add(Dense(num_classes, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
数据有以下维度
x_train.shape is (160, 4000)
y_train_cat is (160, 2)
有两个班。
感谢您阅读本文并提前提供帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.