未验证 提交 c5b3422b 编写于 作者: L littletomatodonkey 提交者: GitHub

add dali v3 (#412)

add dali
上级 baf8431a
...@@ -112,14 +112,14 @@ def main(args): ...@@ -112,14 +112,14 @@ def main(args):
train_reader = Reader(config, 'train')() train_reader = Reader(config, 'train')()
train_dataloader.set_sample_list_generator(train_reader, place) train_dataloader.set_sample_list_generator(train_reader, place)
if config.validate: if config.validate:
if int(os.getenv("PADDLE_TRAINER_ID", 0)) == 0:
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)
else: else:
import dali import dali
train_dataloader = dali.train(config) train_dataloader = dali.train(config)
if config.validate and int(os.getenv("PADDLE_TRAINER_ID", 0)): if config.validate:
if int(os.getenv("PADDLE_TRAINER_ID", 0)) == 0: if int(os.getenv("PADDLE_TRAINER_ID", 0)) == 0:
valid_dataloader = dali.val(config) valid_dataloader = dali.val(config)
compiled_valid_prog = program.compile(config, valid_prog) compiled_valid_prog = program.compile(config, valid_prog)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册