提交 c02e1fb1 编写于 作者: W WuHaobo

use compiled program

上级 9acc8a75
...@@ -72,8 +72,7 @@ def main(args): ...@@ -72,8 +72,7 @@ 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.
先完成此消息的编辑!
想要评论请 注册