未验证 提交 612e0a28 编写于 作者: D dyning 提交者: GitHub

Merge pull request #76 from WuHaobo/master

use compiled program
...@@ -71,9 +71,8 @@ def main(args): ...@@ -71,9 +71,8 @@ def main(args):
valid_reader = Reader(config, 'valid')() valid_reader = Reader(config, 'valid')()
valid_dataloader.set_sample_list_generator(valid_reader, place) valid_dataloader.set_sample_list_generator(valid_reader, place)
#compiled_valid_prog = program.compile(config, valid_prog) compiled_valid_prog = program.compile(config, valid_prog)
compiled_valid_prog = valid_prog
program.run(valid_dataloader, exe, compiled_valid_prog, valid_fetchs, 0, program.run(valid_dataloader, exe, compiled_valid_prog, valid_fetchs, 0,
'valid') 'valid')
......
...@@ -24,7 +24,6 @@ from paddle.fluid.incubate.fleet.base import role_maker ...@@ -24,7 +24,6 @@ from paddle.fluid.incubate.fleet.base import role_maker
from paddle.fluid.incubate.fleet.collective import fleet from paddle.fluid.incubate.fleet.collective import fleet
from ppcls.data import Reader from ppcls.data import Reader
from ppcls.utils import logger
from ppcls.utils.config import get_config from ppcls.utils.config import get_config
from ppcls.utils.save_load import init_model, save_model from ppcls.utils.save_load import init_model, save_model
import program import program
...@@ -86,8 +85,8 @@ def main(args): ...@@ -86,8 +85,8 @@ def main(args):
if config.validate: if config.validate:
valid_reader = Reader(config, 'valid')() valid_reader = Reader(config, 'valid')()
valid_dataloader.set_sample_list_generator(valid_reader, place) valid_dataloader.set_sample_list_generator(valid_reader, place)
#compiled_valid_prog = program.compile(config, valid_prog) compiled_valid_prog = program.compile(config, valid_prog)
compiled_valid_prog = valid_prog
compiled_train_prog = fleet.main_program compiled_train_prog = fleet.main_program
for epoch_id in range(config.epochs): for epoch_id in range(config.epochs):
# 1. train with train dataset # 1. train with train dataset
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册