What is the purpose that Google.Protobuf.CodedInputStream.RecursionLimit is set 10 at the following code?
|
using (var codedStream = Google.Protobuf.CodedInputStream.CreateWithLimits(modelStream, Int32.MaxValue, 10)) |
It is set 100 by default in protocol-buffers C#-wrapper.
https://github.com/protocolbuffers/protobuf/blob/10599e6c8dde8a9875258e03054a696d53cadebd/csharp/src/Google.Protobuf/CodedInputStream.cs#L83
internal const int DefaultRecursionLimit = 100;
I could not load some network / .onnx file by the following exception be caused by RecursionLimit = 10 without the monkey-patched Microsoft.ML.OnnxTransformer.dll.
Google.Protobuf.InvalidProtocolBufferException: Protocol message had too many levels of nesting. May be malicious. Use CodedInputStream.SetRecursionLimit() to increase the depth limit.
I think that the networks are including Inception construction especially.
(ex. tensorflow/models`s Faster-RCNN-Inception-V2 converted)
Thank you for coding great tools!
What is the purpose that
Google.Protobuf.CodedInputStream.RecursionLimitis set10at the following code?machinelearning/src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs
Line 208 in 2a6cf9d
It is set
100by default in protocol-buffers C#-wrapper.https://github.com/protocolbuffers/protobuf/blob/10599e6c8dde8a9875258e03054a696d53cadebd/csharp/src/Google.Protobuf/CodedInputStream.cs#L83
I could not load some network /
.onnxfile by the following exception be caused byRecursionLimit = 10without the monkey-patchedMicrosoft.ML.OnnxTransformer.dll.I think that the networks are including
Inceptionconstruction especially.(ex. tensorflow/models`s Faster-RCNN-Inception-V2 converted)
Thank you for coding great tools!