Hello,
this is due to the different memory layout conventions between pytorch and tensorflow (as a Keras backend).
Pytorch (and e.g. Theano, Keras+Theano) is “channel first”, while Tensorflow and Keras + Tensorflow are “channel last”.
Keras adapts to the backend and has keras.backend.image_data_format() to differentiate between the two.
Best regards
Thomas