【发布时间】:2018-07-25 10:34:59
【问题描述】:
我有这个错误
检查输入时出错:预期 input_13 有 4 个维度,但得到的数组的形状为 (7, 100, 100)
对于以下代码,我应该如何重塑数组以适应 4 维,我搜索了它,但不理解以前的解决方案。如果不清楚它在卷积神经网络中非常常见的问题,请询问。
inputs=Input(shape=(100,100,1))
x=Conv2D(16,(3,3), padding='same')(inputs)
x=Activation('relu')(x)
x=Conv2D(8,(3,3))(x)
x=Activation('relu')(x)
x=MaxPooling2D(pool_size=(2,2))(x)
x=Dropout(0.2)(x)
x=Dense(num_classes)(x)
x=Activation('softmax')(x)
output=Activation('softmax')(x)
model=Model([inputs], output)
【问题讨论】:
标签: python-3.x deep-learning keras conv-neural-network keras-layer