diff --git a/paddle/fluid/operators/checkpoint_load_op.cc b/paddle/fluid/operators/checkpoint_load_op.cc index 026820ca3032473f90186e7deb16fad12a3c8145..241886e2be56694e97b1b8cb069498825da9ab8d 100644 --- a/paddle/fluid/operators/checkpoint_load_op.cc +++ b/paddle/fluid/operators/checkpoint_load_op.cc @@ -87,12 +87,12 @@ class CheckpointLoadOp : public framework::OperatorBase { VLOG(3) << "ready to load var: " << inp_var_names[i]; auto &tensor = var->Get(); - std::ifstream fin(var_file); PADDLE_ENFORCE(static_cast(fin), "Cannot open file %s for load op", var_file); - DeserializeFromStream(fin, tensor, *dev_ctx); + DeserializeFromStream(fin, tensor, dev_ctx); fin.close(); + VLOG(3) << " load var: " << inp_var_names[i] << " finished"; } }