From c69cf6dde879318ea10a7ddc0dd3dabd4d9be358 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Mon, 27 Aug 2018 20:23:28 +0800 Subject: [PATCH] fix --- paddle/fluid/framework/framework.proto | 2 +- paddle/fluid/inference/io.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/framework.proto b/paddle/fluid/framework/framework.proto index 8517d01cfed..460401df547 100644 --- a/paddle/fluid/framework/framework.proto +++ b/paddle/fluid/framework/framework.proto @@ -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; diff --git a/paddle/fluid/inference/io.cc b/paddle/fluid/inference/io.cc index fa59cca3834..1d20643ce01 100644 --- a/paddle/fluid/inference/io.cc +++ b/paddle/fluid/inference/io.cc @@ -125,7 +125,8 @@ std::unique_ptr Load(framework::Executor* executor, std::unique_ptr 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 Load( std::unique_ptr 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; -- GitLab