diff options
author | Lester Solbakken <lesters@users.noreply.github.com> | 2018-01-25 14:17:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 14:17:08 +0100 |
commit | ce0178998956ae2fea340d5e23e9f17c0e5c3db6 (patch) | |
tree | 46ef9c7f4a0ebfe7360cb4f771ac0774bea22d36 /config-model/src/main/java | |
parent | 819533f55f0f137d30c6828b7851a7e0d3010ed7 (diff) | |
parent | 1fe988b927663cd39a8f4189ecf05f202bb5c7c9 (diff) |
Merge pull request #4779 from vespa-engine/bratseth/tensorflow-cleanup
Bratseth/tensorflow cleanup
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java index c95601f6bbf..5343d4622c7 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java @@ -33,7 +33,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.logging.Logger; /** * Replaces instances of the tensorflow(model-path, signature, output) @@ -46,8 +45,6 @@ import java.util.logging.Logger; // TODO: Avoid name conflicts across models for constants public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfileTransformContext> { - private static final Logger log = Logger.getLogger(TensorFlowFeatureConverter.class.getName()); - private final TensorFlowImporter tensorFlowImporter = new TensorFlowImporter(); /** A cache of imported models indexed by model path. This avoids importing the same model multiple times. */ @@ -68,8 +65,8 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil try { ModelStore store = new ModelStore(context.rankProfile().getSearch().sourceApplication(), - feature.getArguments()); - if (store.hasTensorFlowModels()) + feature.getArguments()); + if (store.hasTensorFlowModels()) // TODO: Check if we have created a converted model already instead return transformFromTensorFlowModel(store, context.rankProfile()); else // is should have previously stored model information instead return transformFromStoredModel(store, context.rankProfile()); @@ -206,7 +203,6 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil * Adds this expression to the application package, such that it can be read later. */ public void writeConverted(RankingExpression expression) { - log.info("Writing converted TensorFlow expression to " + arguments.expressionPath()); application.getFile(arguments.expressionPath()) .writeFile(new StringReader(expression.getRoot().toString())); } @@ -214,7 +210,6 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil /** Reads the previously stored ranking expression for these arguments */ public RankingExpression readConverted() { try { - log.info("Reading converted TensorFlow expression from " + arguments.expressionPath()); return new RankingExpression(application.getFile(arguments.expressionPath()).createReader()); } catch (IOException e) { @@ -261,12 +256,10 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil } // Remember the constant in a file we replicate in ZooKeeper - log.info("Writing converted TensorFlow constant information to " + arguments.rankingConstantsPath().append(name + ".constant")); application.getFile(arguments.rankingConstantsPath().append(name + ".constant")) .writeFile(new StringReader(name + ":" + constant.type() + ":" + constantPathCorrected)); // Write content explicitly as a file on the file system as this is distributed using file distribution - log.info("Writing converted TensorFlow constant to " + application.getFileReference(constantPath).getAbsolutePath()); createIfNeeded(constantsPath); IOUtils.writeFile(application.getFileReference(constantPath), TypedBinaryFormat.encode(constant)); return constantPathCorrected; |