From 6c19cc7d640aaf87bf42d01bfb909a1b353b5d79 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Tue, 22 Nov 2022 20:31:24 +0800 Subject: [PATCH] fix paddle2onnx version (#1543) --- paddleslim/common/load_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddleslim/common/load_model.py b/paddleslim/common/load_model.py index 12d0e46f..ced6eaf3 100644 --- a/paddleslim/common/load_model.py +++ b/paddleslim/common/load_model.py @@ -218,11 +218,11 @@ def export_onnx(model_dir, try: import paddle2onnx version = paddle2onnx.__version__ - if version != '1.0.1': - os.system('python -m pip install -U paddle2onnx==1.0.1') + if version < '1.0.1': + os.system('python -m pip install -U paddle2onnx==1.0.3') except: from pip._internal import main - main(['install', 'paddle2onnx==1.0.1']) + main(['install', 'paddle2onnx==1.0.3']) import paddle2onnx paddle2onnx.command.c_paddle_to_onnx( model_file=os.path.join(model_dir, model_filename), -- GitLab