提交 c69cf6dd 编写于 作者: X Xin Pan

fix

上级 56a977d4
......@@ -21,7 +21,7 @@ package paddle.framework.proto;
//
// Serailization and Deserialization codes should be modified in a way
// that supports old versions following the version and compatibility policy.
message Version { optional int64 version = 1 [ default = -1 ]; }
message Version { optional int64 version = 1 [ default = 0 ]; }
enum AttrType {
INT = 0;
......
......@@ -125,7 +125,8 @@ std::unique_ptr<framework::ProgramDesc> Load(framework::Executor* executor,
std::unique_ptr<framework::ProgramDesc> main_program(
new framework::ProgramDesc(program_desc_str));
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()));
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()),
"model version %d is not supported.", main_program->Version());
LoadPersistables(executor, scope, *main_program, dirname, "");
return main_program;
......@@ -140,7 +141,8 @@ std::unique_ptr<framework::ProgramDesc> Load(
std::unique_ptr<framework::ProgramDesc> main_program(
new framework::ProgramDesc(program_desc_str));
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()));
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()),
"model version %d is not supported.", main_program->Version());
LoadPersistables(executor, scope, *main_program, "", param_filename);
return main_program;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册