【问题标题】:Resizing a convolution layer before concatenating in Keras在 Keras 中连接之前调整卷积层的大小
【发布时间】:2018-07-30 12:53:43
【问题描述】:
【问题讨论】:
标签:
deep-learning
keras
semantic-segmentation
【解决方案1】:
Keras 中有一个 Cropping2D 层:https://keras.io/layers/convolutional/#cropping2d
...
conv_13 = Conv2D(64, (3, 3), padding='same', activation='relu')(conv_12) # has outputsize of 568x568
...
crop_13 = Cropping2D((392, 392))(conv_13) # crop 568x568 to 392x392 symmetrically
merge_91 = Concatenate()([crop_13, upsampled_81) # concatenate both layers with same 2D size
...
将第一个尺寸 (568x568) 连接到最后一个上采样尺寸 (392x392) 的示例。