diff --git a/src/TensorFlowNET.Core/Estimators/Training.cs b/src/TensorFlowNET.Core/Estimators/Training.cs index 2d43fa4e..d4540219 100644 --- a/src/TensorFlowNET.Core/Estimators/Training.cs +++ b/src/TensorFlowNET.Core/Estimators/Training.cs @@ -8,8 +8,8 @@ namespace Tensorflow.Estimators { public static void train_and_evaluate() { - var executor = new _TrainingExecutor(); - executor.run(); + //var executor = new _TrainingExecutor(); + //executor.run(); } } } diff --git a/src/TensorFlowNET.Core/Graphs/Graph.Export.cs b/src/TensorFlowNET.Core/Graphs/Graph.Export.cs index 4a7e0ed8..2a0d939e 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.Export.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.Export.cs @@ -14,6 +14,7 @@ limitations under the License. ******************************************************************************/ +using Google.Protobuf; using System.IO; using Tensorflow.Util; @@ -37,7 +38,9 @@ namespace Tensorflow using (var buffer = ToGraphDef(status)) { status.Check(true); - def = GraphDef.Parser.ParseFrom(buffer.MemoryBlock.Stream()); + // limit size to 250M, recursion to max 100 + var inputStream = CodedInputStream.CreateWithLimits(buffer.MemoryBlock.Stream(), 250 * 1024 * 1024, 100); + def = GraphDef.Parser.ParseFrom(inputStream); } // Strip the experimental library field iff it's empty.