From 618c2c75e32075745f8b326fcf02547ace16bf4b Mon Sep 17 00:00:00 2001 From: lujun Date: Mon, 24 Jun 2019 09:24:37 +0800 Subject: [PATCH] [cherry pick] update load_error_info (#18256) Repair error prompt: Users are prompted to check whether the model or parameter files are damaged when loading parameters are wrong. * cherry pick 18000, test=release/1.5 --- 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 8f620ba7d..9d00c1efb 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