Skip to content

Commit 3c3b298

Browse files
darth-vader-lgmichaelgsharpmmitchePrashanth Govindarajaneerhardt
authored
Raising of the recursions limit for onnx model loading. (Issue #5585) (#5796)
* Raised the limit of recursions in the creation of the CodedInputStream in the OnnxTransformer (as the default value in the Google.Protobuf). Otherwise some models cannot be loaded (ex. TF2 Efficentdet). * Updated arcade to the latest version (#5783) * updated arcade to the latest version * updated eng/common correctly * Fixed benchmark test. * Use dotnet certificate (#5794) * Use dotnet certificate * Update 3.1 SDK Co-authored-by: Prashanth Govindarajan <[email protected]> Co-authored-by: Michael Sharp <[email protected]> * Arm build changes (#5789) * arm testing * initial commit with build working on arm64 * windows changes * build fixes for arm/arm64 with cross compilation * cross build instructions added * renamed arm to Arm. Changed TargetArchitecture to default to OS architecture * fixed some formatting * fixed capitilization * fixed Arm Capitilization * Fix cross-compilation if statement * building on apple silicon * removed non build related files * Changes from PR comments. Removal of FastTreeNative flag. * Changes from pr comments. * Fixes from PR comments. * Changed how we are excluding files. * Onnx load model (#5782) * fixed onnx temp model deleting * random file path fixed * updates from pr * Changes from PR comments. * Changed how auto ml caches. * PR fixes. * Update src/Microsoft.ML.AutoML/API/ExperimentSettings.cs Co-authored-by: Eric Erhardt <[email protected]> * Tensorflow fixes from PR comments * fixed filepath issues Co-authored-by: Eric Erhardt <[email protected]> Co-authored-by: Michael Sharp <[email protected]> Co-authored-by: Matt Mitchell <[email protected]> Co-authored-by: Prashanth Govindarajan <[email protected]> Co-authored-by: Eric Erhardt <[email protected]>
1 parent 7fafbf3 commit 3c3b298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public OnnxModel(string modelFile, int? gpuDeviceId = null, bool fallbackToCpu =
204204

205205
// The CodedInputStream auto closes the stream, and we need to make sure that our main stream stays open, so creating a new one here.
206206
using (var modelStream = new FileStream(modelFile, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.Read))
207-
using (var codedStream = Google.Protobuf.CodedInputStream.CreateWithLimits(modelStream, Int32.MaxValue, 10))
207+
using (var codedStream = Google.Protobuf.CodedInputStream.CreateWithLimits(modelStream, Int32.MaxValue, 100))
208208
model = OnnxCSharpToProtoWrapper.ModelProto.Parser.ParseFrom(codedStream);
209209

210210
// Parse actual input and output types stored in the loaded ONNX model to get their DataViewType's.

0 commit comments

Comments
 (0)