我有一个经过预训练的VGG16网络,我使用转移学习修改了PASCAL VOC 2012数据集的网络。现在,我想从修改后的VGG16网络中获取每一层的输出,并在每一层上应用卷积,然后将它们向上采样到相同的大小并相加。这是为了识别图像中的重要区域。我已经从每一层的输出
output = [layer.output for layer in model.layers]
现在我想要像这样的东西
hypercolumns = []
for op in output:
#apply convolution on this output layer
#upsample it to the size of the input image
#store this in hypercolumns list
最后,在对所有层进行上采样之后,我将从列表中添加它们以获得单个矩阵。现在,我对如何应用卷积而不创建模型和进行上采样感到困惑。在凯拉斯有办法吗
有几种方法可以实现这一点,其中一些方法在here in the Keras FAQ中列出。我不知道这里列出的两种主要方法之间有什么显著的区别,所以两种方法都试一下,看看效果如何。下面是您可以做的一个示例:
相关问题 更多 >
编程相关推荐