Browse Source

Protocol message was too large when parsing to GraphDef. #383

tags/v0.12
Oceania2018 6 years ago
parent
commit
24418b7653
2 changed files with 6 additions and 3 deletions
  1. +2
    -2
      src/TensorFlowNET.Core/Estimators/Training.cs
  2. +4
    -1
      src/TensorFlowNET.Core/Graphs/Graph.Export.cs

+ 2
- 2
src/TensorFlowNET.Core/Estimators/Training.cs View File

@@ -8,8 +8,8 @@ namespace Tensorflow.Estimators
{ {
public static void train_and_evaluate() public static void train_and_evaluate()
{ {
var executor = new _TrainingExecutor();
executor.run();
//var executor = new _TrainingExecutor();
//executor.run();
} }
} }
} }

+ 4
- 1
src/TensorFlowNET.Core/Graphs/Graph.Export.cs View File

@@ -14,6 +14,7 @@
limitations under the License. limitations under the License.
******************************************************************************/ ******************************************************************************/


using Google.Protobuf;
using System.IO; using System.IO;
using Tensorflow.Util; using Tensorflow.Util;


@@ -37,7 +38,9 @@ namespace Tensorflow
using (var buffer = ToGraphDef(status)) using (var buffer = ToGraphDef(status))
{ {
status.Check(true); 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. // Strip the experimental library field iff it's empty.


Loading…
Cancel
Save