diff --git a/python/paddle/jit/dy2static/origin_info.py b/python/paddle/jit/dy2static/origin_info.py index 40afab7459e5356bddd9a41af9387313ce0cfccc..8d6b01a04e481c48235dda2351494a7d21528394 100644 --- a/python/paddle/jit/dy2static/origin_info.py +++ b/python/paddle/jit/dy2static/origin_info.py @@ -329,6 +329,11 @@ def update_op_callstack_with_origin_info(program): callstack = get_new_op_callstack(callstack) - op._set_attr(callstack_var_name, callstack) + try: + # (@xiongkun) In 2-order derivative for paddle science, there may exists `pow_grad` + # which has op_proto == nullptr and causes _set_attr failed. so we add a try...except. + op._set_attr(callstack_var_name, callstack) + except: + pass return program