Custom Lambda layer Keras outputs predictions. I get 'An operation has `None` for gradient' error
I think it comes from your 'custom_layer'. Not all functions defined in keras backend are differentiable (as the error says, for example K.argmax) if you use these functions on your layer and they don't have a defined gradient, it will rise this error. You have to make sure that you use only functions that has a gradient associated. Although there is no an official list of these functions, basic operations (+/-*) are, for example equal_toor greaterare not differentiable.