Skip to content

Commit c69cf6d

Browse files
committed
fix
1 parent 56a977d commit c69cf6d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

paddle/fluid/framework/framework.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package paddle.framework.proto;
2121
//
2222
// Serailization and Deserialization codes should be modified in a way
2323
// that supports old versions following the version and compatibility policy.
24-
message Version { optional int64 version = 1 [ default = -1 ]; }
24+
message Version { optional int64 version = 1 [ default = 0 ]; }
2525

2626
enum AttrType {
2727
INT = 0;

paddle/fluid/inference/io.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ std::unique_ptr<framework::ProgramDesc> Load(framework::Executor* executor,
125125

126126
std::unique_ptr<framework::ProgramDesc> main_program(
127127
new framework::ProgramDesc(program_desc_str));
128-
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()));
128+
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()),
129+
"model version %d is not supported.", main_program->Version());
129130

130131
LoadPersistables(executor, scope, *main_program, dirname, "");
131132
return main_program;
@@ -140,7 +141,8 @@ std::unique_ptr<framework::ProgramDesc> Load(
140141

141142
std::unique_ptr<framework::ProgramDesc> main_program(
142143
new framework::ProgramDesc(program_desc_str));
143-
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()));
144+
PADDLE_ENFORCE(framework::IsProgramVersionSupported(main_program->Version()),
145+
"model version %d is not supported.", main_program->Version());
144146

145147
LoadPersistables(executor, scope, *main_program, "", param_filename);
146148
return main_program;

0 commit comments

Comments
 (0)