From e9fc0c703a7b6e51a69888da651fe34e23fd4044 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Thu, 12 Jan 2023 14:19:22 +0800 Subject: [PATCH] Fix opset version Signed-off-by: Jael Gu --- auto_transformers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auto_transformers.py b/auto_transformers.py index 0a601a2..496f989 100644 --- a/auto_transformers.py +++ b/auto_transformers.py @@ -212,7 +212,8 @@ class AutoTransformers(NNOperator): input_names=list(self.onnx_config['inputs'].keys()), output_names=list(self.onnx_config['outputs'].keys()), dynamic_axes=dynamic_axes, - opset_version=torch.onnx.constant_folding_opset_versions[-1], + opset_version=torch.onnx.constant_folding_opset_versions[-1] if hasattr( + torch.onnx, 'constant_folding_opset_versions') else 14, do_constant_folding=True, ) # todo: elif format == 'tensorrt':