未验证 提交 bcb1516d 编写于 作者: Y yuyang18

Run test startup

上级 6e38de1c
...@@ -75,11 +75,13 @@ def main(): ...@@ -75,11 +75,13 @@ def main():
adam.minimize(loss) adam.minimize(loss)
test_prog = fluid.Program() test_prog = fluid.Program()
with fluid.program_guard(test_prog, fluid.Program()): test_startup = fluid.Program()
with fluid.program_guard(test_prog, test_startup):
with fluid.unique_name.guard(): with fluid.unique_name.guard():
test_loss, test_queue, test_reader = network(False) test_loss, test_queue, test_reader = network(False)
fluid.Executor(fluid.CUDAPlace(0)).run(startup_prog) fluid.Executor(fluid.CUDAPlace(0)).run(startup_prog)
fluid.Executor(fluid.CUDAPlace(0)).run(test_startup)
trainer = fluid.ParallelExecutor( trainer = fluid.ParallelExecutor(
use_cuda=True, loss_name=loss.name, main_program=train_prog) use_cuda=True, loss_name=loss.name, main_program=train_prog)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册