title: Keras RGB to Grayscale
body: <p>I would like a canonical answer on the best way to convert input rgb images to grayscale in Keras. <a href="https://stackoverflow.com/questions/43033739/how-to-convert-images-color-space-in-keras">This answer</a> hints that perhaps such a thing would be best achieved with a Lambda, but that feels inefficient to me. It seems to me that <a href="https://keras.io/layers/pooling/#averagepooling2d" rel="noreferrer">Average Pooling layers</a> should be able to do the trick, but I can't seem to figure that out. Is there an RGB to Grayscale layer that I am just missing in the docs? It seems like that is a pretty commonplace operation. </p>