From 75fcd2922067a3eb90adb37e0951a5365375b7bf Mon Sep 17 00:00:00 2001 From: lujun Date: Wed, 12 Jun 2019 16:20:15 +0800 Subject: [PATCH] update load_error_info, test=develop (#18000) Repair error prompt: Users are prompted to check whether the model or parameter files are damaged when loading parameters are wrong. --- paddle/fluid/operators/load_combine_op.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/load_combine_op.h b/paddle/fluid/operators/load_combine_op.h index 8f620ba7d2f..45a155af852 100644 --- a/paddle/fluid/operators/load_combine_op.h +++ b/paddle/fluid/operators/load_combine_op.h @@ -65,7 +65,10 @@ class LoadCombineOpKernel : public framework::OpKernel { auto *tensor = out_vars[i]->GetMutable(); // Error checking - PADDLE_ENFORCE(static_cast(*buffer), "Cannot read more"); + PADDLE_ENFORCE( + static_cast(*buffer), + "There is a problem with loading model parameters. " + "Please check whether the model file is complete or damaged."); // Get data from fin to tensor DeserializeFromStream(*buffer, tensor, dev_ctx); -- GitLab