From b677d8216e4454fadfc5204e00f7d483bb189368 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Wed, 16 May 2018 16:48:16 +0800 Subject: [PATCH] bug fix --- paddle/fluid/operators/checkpoint_load_op.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/checkpoint_load_op.cc b/paddle/fluid/operators/checkpoint_load_op.cc index 026820ca303..241886e2be5 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"; } } -- GitLab