From 676d0b42fdf482e7a9dd80d384ca8139041a0d14 Mon Sep 17 00:00:00 2001 From: Ruibiao Chen Date: Fri, 15 Jul 2022 14:52:41 +0800 Subject: [PATCH] Fix run inference bug for standalone executor (#44340) --- python/paddle/fluid/executor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index fac39df117b..cf00075edcf 100755 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1404,10 +1404,14 @@ class Executor(object): return False # Unsupported case 3: data parallel - if program._is_data_parallel == True and len( + if program._is_data_parallel and len( program._get_places(place, program._places)) != 1: return False + # Unsupported case 4: inference + if program._is_inference: + return False + return True else: if isinstance(program._graph, compiler.CompiledProgram): -- GitLab