diff --git a/paddle/fluid/inference/io.cc b/paddle/fluid/inference/io.cc index ae72a74acce826c3635d5d537540eaad79ff8199..8b379457a2d031dbe859562c1a8dade0badc56c2 100644 --- a/paddle/fluid/inference/io.cc +++ b/paddle/fluid/inference/io.cc @@ -85,7 +85,12 @@ void LoadPersistables(framework::Executor* executor, framework::Scope* scope, new_var->SetShape(var->GetShape()); new_var->SetDataType(var->GetDataType()); new_var->SetType(var->GetType()); - new_var->SetLoDLevel(var->GetLoDLevel()); + + if (var->GetType() != + framework::proto::VarType::Type::VarType_Type_SELECTED_ROWS) { + new_var->SetLoDLevel(var->GetLoDLevel()); + } + new_var->SetPersistable(true); if (!param_filename.empty()) {