You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this whilst trying to parse the TensorProtos produced by Tensorflow.
For an example, Tensorflow returns the following protobuf (tensor_shape.dim.size is an int64) for a 1x1 tensor of type float that has value 3.0: dtype: DT_FLOAT tensor_shape { dim { size: 1 } dim { size: 1 } } float_val: 3.0
with binary encoding as: [8, 1, 18, 8, 18, 2, 8, 1, 18, 2, 8, 1, 42, 4, 0, 0, 64, 64], in hex: '0x8 0x1 0x12 0x8 0x12 0x2 0x8 0x1 0x12 0x2 0x8 0x1 0x2a 0x4 0x0 0x0 0x40 0x40
When parsing this with protobufjs 6.0.0, I get RangeError: index out of range: 18 + 1 > 18
However, when parsing with protobufjs 5, the message is parsed correctly.
Ran into this whilst trying to parse the TensorProtos produced by Tensorflow.
For an example, Tensorflow returns the following protobuf (tensor_shape.dim.size is an int64) for a 1x1 tensor of type float that has value 3.0:
dtype: DT_FLOAT tensor_shape { dim { size: 1 } dim { size: 1 } } float_val: 3.0
with binary encoding as:
[8, 1, 18, 8, 18, 2, 8, 1, 18, 2, 8, 1, 42, 4, 0, 0, 64, 64]
, in hex:'0x8 0x1 0x12 0x8 0x12 0x2 0x8 0x1 0x12 0x2 0x8 0x1 0x2a 0x4 0x0 0x0 0x40 0x40
When parsing this with protobufjs 6.0.0, I get
RangeError: index out of range: 18 + 1 > 18
However, when parsing with protobufjs 5, the message is parsed correctly.
If I modify TensorProto to be
The message is parsed correctly (but missing the floatVal, as it's been commented out)
The text was updated successfully, but these errors were encountered: