From e7d87c09fcc2295754a7a53358b91ace76750676 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Thu, 30 Aug 2018 22:11:38 +0800 Subject: [PATCH] Fix generator not closed when iteration end bug --- benchmark/fluid/fluid_benchmark.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmark/fluid/fluid_benchmark.py b/benchmark/fluid/fluid_benchmark.py index 6b22f8f520..53d010434a 100644 --- a/benchmark/fluid/fluid_benchmark.py +++ b/benchmark/fluid/fluid_benchmark.py @@ -151,6 +151,7 @@ def train(avg_loss, infer_prog, optimizer, train_reader, test_reader, batch_acc, if data == None: break if iters == args.iterations: + reader_generator.close() break if iters == args.skip_batch_num: start_time = time.time() @@ -252,6 +253,7 @@ def train_parallel(avg_loss, infer_prog, optimizer, train_reader, test_reader, if data == None: break if iters == args.iterations: + reader_generator.close() break if args.profile and pass_id == 0 and batch_id == 5: profiler.start_profiler("All") -- GitLab