diff --git a/python/paddle/fluid/framework.py b/python/paddle/fluid/framework.py index 2cceeabfc4c23..7b59c538e53ec 100644 --- a/python/paddle/fluid/framework.py +++ b/python/paddle/fluid/framework.py @@ -6100,7 +6100,7 @@ def _inference_optimize(self, prune_read_op=True): for j in range(block.op_size()): op = block.op(j) if op.has_attr('is_test'): - op._set_attr('is_test', True) + op._set_bool_attr('is_test', True) if op.type() == "batch_norm": # Remove the output ReserveSpace of batch_norm if exists. op.remove_output("ReserveSpace")