diff --git a/paddlex/inference/components/paddle_predictor/predictor.py b/paddlex/inference/components/paddle_predictor/predictor.py index cbf66f977..365aab16c 100644 --- a/paddlex/inference/components/paddle_predictor/predictor.py +++ b/paddlex/inference/components/paddle_predictor/predictor.py @@ -181,7 +181,8 @@ def _create(self): config.enable_new_ir(self.option.enable_new_ir) if hasattr(config, "enable_new_executor"): config.enable_new_executor() - config.set_optimization_level(3) + if self.option.device in ("cpu", "gpu"): + config.set_optimization_level(3) for del_p in self.option.delete_pass: config.delete_pass(del_p)