我正在研究一个将keras json模型转换为caffe prototxt的项目
caffe支持任意填充值
keras(在tensorflow之上)支持’相同’和’有效’值
对于caffe中的任何填充值,我们可以在keras中手动添加ZeroPadding图层,然后应用“有效”方案以获得相同的输出尺寸
从
https://github.com/MarcBS/keras/blob/master/keras/caffe/README.md
Given the differences between Caffe and Keras when applying the MAX pooling opperation, in some occasions the MAX pooling layers must include a
pad: 1
value even if they did not include them in their original .prototxt
这两个框架之间MAX池的实现有什么区别?
最佳答案 池的实现差异 – 在keras中,半窗口被丢弃. Caffe将为半窗增加额外的输出.
填充方案的差异 – keras中的“相同”填充有时会导致上下(或左右)的填充值不同. caffe始终在两侧均匀填充,因此上下(或左右)填充值始终相等.