NCHW vs NHWC in Machine Learning
The only difference is when you need to carry out certain operations across the channel axis such as BatchNormalisation. If you look at https://keras.io/layers/normalization/, one of the parameters for batch normalisation is as such:


  axis: Integer, the axis that should be normalized (typically the
  features axis). For instance, after a Conv2D layer with
  data_format="channels_first", set axis=1 in BatchNormalization


You need to provide the axis as the model needs to know to carry out normalisation across which axis. Other than that, it doesn't make a difference in training.