Skip to content

Commit 618c2c7

Browse files
authored
[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
1 parent 6125a58 commit 618c2c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle/fluid/operators/load_combine_op.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ class LoadCombineOpKernel : public framework::OpKernel<T> {
6565
auto *tensor = out_vars[i]->GetMutable<framework::LoDTensor>();
6666

6767
// Error checking
68-
PADDLE_ENFORCE(static_cast<bool>(*buffer), "Cannot read more");
68+
PADDLE_ENFORCE(
69+
static_cast<bool>(*buffer),
70+
"There is a problem with loading model parameters. "
71+
"Please check whether the model file is complete or damaged. ");
6972

7073
// Get data from fin to tensor
7174
DeserializeFromStream(*buffer, tensor, dev_ctx);

0 commit comments

Comments
 (0)