Skip to content

Commit

Permalink
Fix large_model judgement (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengniwang95 authored Jul 7, 2023
1 parent c1ae63d commit 1b5337e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neural_compressor/model/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def __init__(self, model, **kwargs):
try:
ort.InferenceSession(self._model.SerializeToString())
except Exception as e: # pragma: no cover
if 'maximum protobuf size of 2GB' in str(e) or 'string length exceeds max size' in str(e):
if 'maximum protobuf size of 2GB' in str(e) or 'string length exceeds max size' in str(e) or \
'protobuf parsing failed' in str(e):
self._is_large_model = True
if self._model_path is None:
logger.warning('Please use model path instead of onnx model object to quantize')
Expand Down

0 comments on commit 1b5337e

Please sign in to comment.