From 07b75a88bd36ae3f70c5ad0c7add8508fc79af67 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Mon, 22 Feb 2021 13:27:55 +0800 Subject: [PATCH] fix switch_ir_optim in deploy/infer (#2230) --- dygraph/deploy/python/infer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dygraph/deploy/python/infer.py b/dygraph/deploy/python/infer.py index 911c4fd97..4d9feb214 100644 --- a/dygraph/deploy/python/infer.py +++ b/dygraph/deploy/python/infer.py @@ -316,7 +316,11 @@ def load_predictor(model_dir, # initial GPU memory(M), device ID config.enable_use_gpu(200, 0) # optimize graph and fuse op - config.switch_ir_optim(True) + # FIXME(dkp): ir optimize may prune variable inside graph + # and incur error in Paddle 2.0, e.g. in SSDLite + # FCOS model, set as False currently and should + # be set as True after switch_ir_optim fixed + config.switch_ir_optim(False) else: config.disable_gpu() -- GitLab