Skip to content

Commit

Permalink
Allow lower ONNX opsets (#1650)
Browse files Browse the repository at this point in the history
* downgrade opset

* actually just warn instead of raising an error
  • Loading branch information
fxmarty authored and echarlaix committed Jan 19, 2024
1 parent eda30df commit 3bdd132
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimum/exporters/onnx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ def main_export(
opset = onnx_config.DEFAULT_ONNX_OPSET

if opset < onnx_config.DEFAULT_ONNX_OPSET:
raise ValueError(
f"Opset {opset} is not sufficient to export {model_type}. "
f"At least {onnx_config.DEFAULT_ONNX_OPSET} is required."
logger.warning(
f"Opset {opset} is lower than the recommended minmum opset ({onnx_config.DEFAULT_ONNX_OPSET}) to export {model_type}. "
f"The ONNX export may fail or the exported model may be suboptimal."
)
if atol is None:
atol = onnx_config.ATOL_FOR_VALIDATION
Expand Down

0 comments on commit 3bdd132

Please sign in to comment.