diff --git a/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessors/ReshapePreprocessor.java b/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessors/ReshapePreprocessor.java index 19f2d1df9..106f00914 100644 --- a/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessors/ReshapePreprocessor.java +++ b/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/preprocessors/ReshapePreprocessor.java @@ -106,7 +106,6 @@ public class ReshapePreprocessor extends BaseInputPreProcessor { public INDArray preProcess(INDArray input, int miniBatchSize, LayerWorkspaceMgr workspaceMgr) { // the target shape read from a keras config does not have mini-batch size included. We prepend it here dynamically. long[] targetShape = getShape(this.targetShape, miniBatchSize); - long[] inputShape = getShape(this.inputShape, miniBatchSize); if (prodLong(input.shape()) == prodLong((targetShape))) { if (input.ordering() != 'c' || !Shape.hasDefaultStridesForShape(input)) { @@ -115,7 +114,7 @@ public class ReshapePreprocessor extends BaseInputPreProcessor { return workspaceMgr.leverageTo(ArrayType.ACTIVATIONS, input.reshape(targetShape)); } else { throw new IllegalStateException("Input shape " + Arrays.toString(input.shape()) - + " and output shape" + Arrays.toString(inputShape) + " do not match"); + + " and target shape" + Arrays.toString(targetShape) + " do not match"); } } @@ -178,4 +177,4 @@ public class ReshapePreprocessor extends BaseInputPreProcessor { } return ret; } -} \ No newline at end of file +}