From 124d0a1965c99e5c8a8fb39430fb82a710df600f Mon Sep 17 00:00:00 2001 From: Mario Lorenzo <53198701+mjlorenzo305@users.noreply.github.com> Date: Wed, 20 Jan 2021 21:50:36 -0500 Subject: [PATCH] Squashed and signed, last try (#9136) Signed-off-by: mjlorenzo305 --- .../modelimport/keras/preprocessors/ReshapePreprocessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 +}