提交 afc0c34c 编写于 作者: X xiexionghang

add inference model

上级 c00354af
......@@ -32,7 +32,7 @@ namespace feed {
_inference_model_base_done_path = fs->path_join(_inference_model_path,
config["inference_base_done_name"].as<std::string>("xbox_base_done.txt"));
_inference_model_delta_done_path = fs->path_join(_inference_model_path,
config["inference_delta_done_name"].as<std::string>("xbox_delta_done.txt"));
config["inference_delta_done_name"].as<std::string>("xbox_patch_done.txt"));
return 0;
}
......@@ -149,7 +149,7 @@ namespace feed {
if (is_last_epoch(epoch_id)) {
return true;
}
return delta_id(epoch_id) % 24 == 0;
return delta_id(epoch_id) % 78 == 0;
}
return false;
}
......
......@@ -79,7 +79,7 @@ int MultiThreadExecutor::initialize(YAML::Node exe_config,
CHECK(accessor_ptr->collect_persistables_name(_persistables) == 0)
<< "collect_persistables Failed, class:" << accessor_class;
}
// std::sort(_persistables.begin(), _persistables.end()); // 持久化变量名一定要排序
std::sort(_persistables.begin(), _persistables.end()); // 持久化变量名一定要排序
// Monitor组件
for (const auto& monitor_config : _model_config["monitor"]) {
......
......@@ -131,6 +131,11 @@ class ModelBuilder:
main_program=test_program,
model_filename='inference_program',
program_only=True)
with open(os.path.join(self._save_path, 'inference_program'), "rb") as f:
program_desc_str = f.read()
infer_program = fluid.Program.parse_from_string(program_desc_str)
with open(os.path.join(self._save_path, 'inference_program.pbtxt'), 'w') as fout:
fout.write(str(infer_program))
params = filter(fluid.io.is_parameter, main_program.list_vars())
vars = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册