diff --git a/benchmark/fluid/fluid_benchmark.py b/benchmark/fluid/fluid_benchmark.py index 6b22f8f520e3d9c6c89d41a7455a6f9ebbad6d80..53d010434a8ebbe0184d84f588783f25186d606a 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")