Unable to import keras model

I get the following error when I try to load in a pretrained model in keras.
The model was loaded in via: KerasModelImport.importKerasModelAndWeights(path, false);

Exception in thread “main” org.deeplearning4j.nn.conf.inputs.InvalidInputTypeException: Invalid input: MergeVertex cannot merge CNN activations of different width/heights:first [channels,width,height] = [256,593,117], input 1 = [128,594,117]

            at org.deeplearning4j.nn.conf.graph.MergeVertex.getOutputType(MergeVertex.java:208)

The model I load is of Unet-like architecture, but at the concatenation step {concat[Input1, Input2]}; i crop input1 if the dimensions are not equal to input2. I think this is causing the problem, as I have a function that I call at each concatenation step to check if cropping is needed and by how much. I believe the crop value is not being changed at each concatenation step in DL4j when loading in the pretrained model. And ideas or possible workarounds?

@SSdev do you have the models and a sample input for me to look at?

Thanks for your help @agibsonccc,
A sample model is in the link:

you can use a input matrix of ones with size [1, 468, 2376,1], ordered by batch size, width, height and channel (in keras).

The model was created and trained in keras; I am trying to load this model for prediction using DL4j

@SSdev ok confirmed this on the newest version as well. I’ll need to dig in to this a bit. Sorry for the late reply.

Thanks @agibsonccc,
the version i am using is the 1.0.0-beta7

Just confirming publicly this was a bug and will be fixed in master. Snapshots to follow. For now, I converted the model manually and gave it to @SSdev for testing.