diff --git a/lite/model_parser/model_parser.cc b/lite/model_parser/model_parser.cc index 08e6a303094dc42278bfcb24c54f16bd3819d5c1..7f938577c3b2e53257d4fb79686a0bf8c6a67ad5 100644 --- a/lite/model_parser/model_parser.cc +++ b/lite/model_parser/model_parser.cc @@ -382,7 +382,7 @@ void TensorToStream(std::ostream &os, const lite::Tensor &tensor) { pb_dims->Resize(static_cast(dims.size()), 0); auto dims_vec = dims.Vectorize(); std::copy(dims_vec.begin(), dims_vec.end(), pb_dims->begin()); - int32_t size = desc.ByteSize(); + int32_t size = desc.ByteSizeLong(); os.write(reinterpret_cast(&size), sizeof(size)); auto out = desc.SerializeAsString(); os.write(out.data(), size);