提交 be32e70d 编写于 作者: J jingqinghe

update trainer code

上级 fd96a1e8
...@@ -47,17 +47,6 @@ place = fluid.CPUPlace() ...@@ -47,17 +47,6 @@ place = fluid.CPUPlace()
trainer.start(place) trainer.start(place)
print("scheduler_ep is {}, current_ep is {}".format(trainer._scheduler_ep, print("scheduler_ep is {}, current_ep is {}".format(trainer._scheduler_ep,
trainer._current_ep)) trainer._current_ep))
"""
feed_vars = {}
target_vars = {}
for target in trainer._target_names:
tmp_target = trainer._main_program.block(0)._find_var_recursive(target)
target_vars[target] = tmp_target
for feed in trainer._feed_names:
tmp_feed = trainer._main_program.block(0)._find_var_recursive(feed)
feed_vars[feed] = tmp_feed
"""
epoch_id = 0 epoch_id = 0
while not trainer.stop(): while not trainer.stop():
if epoch_id > 10: if epoch_id > 10:
...@@ -73,6 +62,4 @@ while not trainer.stop(): ...@@ -73,6 +62,4 @@ while not trainer.stop():
break break
epoch_id += 1 epoch_id += 1
if epoch_id % 5 == 0: if epoch_id % 5 == 0:
# trainer.save_inference_program(output_folder) trainer.save_serving_model("imdb_server_model", "imdb_client_conf")
trainer.save_serving_model("test", "imdb_client_conf")
# serving_io.save_model("test","imdb_client_conf", feed_vars, target_vars, trainer._main_program)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册