У меня есть список из примерно 70 000 обучающих изображений, каждое из которых имеет форму (количество цветовых каналов, ширина по высоте) = (3, 30, 30), и около 20 000 тестовых изображений. Мой сверточный автоэнкодер определяется как:
# Same as the code above, but with some params changed
# Now let's define the model.
# Set input dimensions:
input_img = Input(shape=(3, 30, 30))
# Encoder: define a chain of Conv2D and MaxPooling2D layers
x = Convolution2D(128, 3, 3,
activation='relu',
border_mode='same')(input_img)
x = MaxPooling2D((2, 2), border_mode='same')(x)
x = Convolution2D(64, 3, 3,
activation='relu',
border_mode='same')(x)
x = MaxPooling2D((2, 2), border_mode='same')(x)
x = Convolution2D(64, 3, 3,
activation='relu',
border_mode='same')(x)
encoded = MaxPooling2D((2, 2), border_mode='same')(x)
# at this point, the representation is (8, 4, 4) i.e. 128-dimensional
# Decoder: a stack of Conv2D and UpSampling2D layers
x = Convolution2D(64, 3, 3,
activation='relu',
border_mode='same')(encoded)
x = UpSampling2D((2, 2))(x)
x = Convolution2D(64, 3, 3,
activation='relu',
border_mode='same')(x)
x = UpSampling2D((2, 2))(x)
x = Convolution2D(128, 3, 3,
activation='relu')(x)
x = UpSampling2D((2, 2))(x)
decoded = Convolution2D(1, 3, 3,
activation='sigmoid',
border_mode='same')(x)
autoencoder2 = Model(input_img, decoded)
autoencoder2.compile(optimizer='adadelta', loss='mse')
Это автоэнкодер из здесь.
Выдает ошибку:
Error when checking model target: expected convolution2d_14 to have shape (None, 1, 28, 28) but got array with shape (76960, 3, 30, 30)
что странно, потому что я явно изменил указанную форму ввода как (3, 30, 30). Есть ли какие-то особенности реализации, которые мне не хватает?