我在这里测试 Keras 的作者的卷积自动编码器: https ://blog.keras.io/building-autoencoders-in-keras.html
但我有这个问题:
Exception: Error when checking model target: expected convolution2d_7 to have shape (None, 8, 32, 1) but got array with shape (60000, 1, 28, 28)
我准确地说,我已经在最后一个 conv 层中设置了字段 'border_mode='same''。所以我真的不知道它来自哪里..这是摘要:
Layer (type) Output Shape Param # Connected to
====================================================================================================
input_1 (InputLayer) (None, 1, 28, 28) 0
____________________________________________________________________________________________________
convolution2d_1 (Convolution2D) (None, 1, 28, 16) 4048 input_1[0][0]
____________________________________________________________________________________________________
maxpooling2d_1 (MaxPooling2D) (None, 1, 14, 16) 0 convolution2d_1[0][0]
______________________________________________________________________________ ______________________
convolution2d_2 (Convolution2D) (None, 1, 14, 8) 1160 maxpooling2d_1[0][0]
____________________________________________________________________________________________________
maxpooling2d_2 (MaxPooling2D) (None, 1, 7, 8) 0 convolution2d_2[0][0]
____________________________________________________________________________________________________
convolution2d_3 (Convolution2D) (None, 1, 7, 8) 584 maxpooling2d_2[0][0]
____________________________________________________________________________________________________
maxpooling2d_3 (MaxPooling2D) (None, 1, 4, 8) 0 convolution2d_3[0][0]
____________________________________________________________________________________________________
convolution2d_4 (Convolution2D) (None, 1, 4, 8) 584 maxpooling2d_3[0][0]
____________________________________________________________________________________________________
upsampling2d_1 (UpSampling2D) (None, 2, 8, 8) 0 convolution2d_4[0][0]
____________________________________________________________________________________________________
convolution2d_5 (Convolution2D) (None, 2, 8, 8) 584 upsampling2d_1[0][0]
____________________________________________________________________________________________________
upsampling2d_2 (UpSampling2D) (None, 4, 16, 8) 0 convolution2d_5[0][0]
____________________________________________________________________________________________________
convolution2d_6 (Convolution2D) (None, 4, 16, 16) 1168 upsampling2d_2[0][0]
____________________________________________________________________________________________________
upsampling2d_3 (UpSampling2D) (None, 8, 32, 16) 0 convolution2d_6[0][0]
______________________________________________________________________________ ______________________
convolution2d_7 (Convolution2D) (None, 8, 32, 1) 145
upsampling2d_3[0][0]
====================================================================================================
Total params: 8273
____________________________________________________________________________________________________