第一种策略:将tensorflow tensor转keras tensor
1.索引操作转换
#转换前
x = self.x[:, :, :, :]
#转换后
x=Lambda(lambda x: x[:, :, :, :])(self.x)
2.tf操作以及K操作转换
x=Lambda(lambda x: K.round(x))(x)
3.带有非tensor参数的函数转换
offset = Lambda(self.conv,arguments={'co': 2 * N, 'mode': 'offset'})(x)