【发布时间】:2021-03-14 12:11:38
【问题描述】:
我正在尝试为图像训练密集网络。
火车集合形状返回:
train_X.shape
(26032, 32, 32)
网络架构是:
def get_model(input_shape):
model = Sequential([
Dense(16, activation='relu', input_shape=(input_shape[1],input_shape[2],1)),
Dense(8, activation='relu'),
Dense(64, activation='relu'),
Flatten(),
Dense(10, activation='softmax')])
return model
但是当我尝试训练它时出现错误:
检查输入时出错:预期的 dense_17_input 有 4 个维度,但得到的数组的形状为 (73257, 32, 32)
你能帮忙吗?
【问题讨论】:
标签: python tensorflow keras tensorflow2.0