Keras model import problem: NHWC or NCHW

I have a problem, because the input data shape is NHWC, but the input data shape of imported Keras is NCHW, how can I solve this problem?

ComputationGraph vgg16Transfer = new TransferLearning.GraphBuilder(simplemodel)
.fineTuneConfiguration(fineTuneConf)
.setFeatureExtractor(“conv_pw_13_bn”) //the specified layer and below are “frozen”
.build();

Cannot do forward pass in Convolution layer (layer name = conv1, layer index = 2): input array channels does not match CNN layer configuration (data format = NHWC, data input channels = 224, [minibatch, height, width, channels]=[16, 4, 225, 224]; expected input channels = 3) (layer name: conv1, layer index: 2, layer type: ConvolutionLayer)

@YourPeer could you clarify what it is you’re having issues with? Is this keras + transfer learning in dl4j? Separating the 2 questions would help. Ideally something end to end I could run would help. I’d also like to know your version you’re using.

Thank you very much for your reply! I’m using DL4J-M1.1 version and I want to deploy transfer learning on my android phone. I’m currently importing Mobilenet(keras) model successfully, but when I feed data to the model, I have a channel mismatch problem, actually the model requires the input data format to be NHWC, however my data format is NCHW. The data is provided by DL4J–Flowers dataset.