diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 546c19d536f2e52609aafbb7896686bfa8d62374..1f4220e519115812dcdc3e34e16711a14d4c7366 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -653,10 +653,8 @@ def load_vars(executor, continue if isinstance(each_var, Parameter): - var_temp = paddle.fluid.global_scope().find_var(each_var.name) - assert var_temp != None, "can't not find var: " + each_var.name - orig_para_shape[each_var.name] = ( - np.array(var_temp.get_tensor())).shape + orig_para_shape[each_var.name] = tuple(each_var.desc.get_shape( + )) new_var = _clone_var_in_block_(load_block, each_var) if filename is None: load_block.append_op(