From 1ef5f2c3e834a26137907d9150307ba257fa2568 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Thu, 16 Aug 2018 18:12:28 +0800 Subject: [PATCH] Make flowers reader and parallel_executor more efficient --- python/paddle/dataset/flowers.py | 2 +- python/paddle/fluid/parallel_executor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/dataset/flowers.py b/python/paddle/dataset/flowers.py index 17c768424..aa73bbaf7 100644 --- a/python/paddle/dataset/flowers.py +++ b/python/paddle/dataset/flowers.py @@ -120,7 +120,7 @@ def reader_creator(data_file, file = file.strip() batch = None with open(file, 'rb') as f: - batch = pickle.loads(f.read()) + batch = pickle.load(f) data = batch['data'] labels = batch['label'] for sample, label in zip(data, batch['label']): diff --git a/python/paddle/fluid/parallel_executor.py b/python/paddle/fluid/parallel_executor.py index ac87b12a1..a7765c959 100644 --- a/python/paddle/fluid/parallel_executor.py +++ b/python/paddle/fluid/parallel_executor.py @@ -273,7 +273,7 @@ class ParallelExecutor(object): self.executor.feed_tensors_into_local_scopes(res) fetch_var_name = '@FETCHED_VAR_NAME@' - self.executor.run(cpt.to_text(fetch_list), cpt.to_text(fetch_var_name)) + self.executor.run(fetch_list, fetch_var_name) arr = self.scope.find_var(fetch_var_name).get_lod_tensor_array() if self.is_dist: -- GitLab