Skip to content

Commit 1ef5f2c

Browse files
committed
Make flowers reader and parallel_executor more efficient
1 parent e398348 commit 1ef5f2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/paddle/dataset/flowers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def reader():
120120
file = file.strip()
121121
batch = None
122122
with open(file, 'rb') as f:
123-
batch = pickle.loads(f.read())
123+
batch = pickle.load(f)
124124
data = batch['data']
125125
labels = batch['label']
126126
for sample, label in zip(data, batch['label']):

python/paddle/fluid/parallel_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def run(self, fetch_list, feed=None, feed_dict=None, return_numpy=True):
273273
self.executor.feed_tensors_into_local_scopes(res)
274274

275275
fetch_var_name = '@FETCHED_VAR_NAME@'
276-
self.executor.run(cpt.to_text(fetch_list), cpt.to_text(fetch_var_name))
276+
self.executor.run(fetch_list, fetch_var_name)
277277
arr = self.scope.find_var(fetch_var_name).get_lod_tensor_array()
278278

279279
if self.is_dist:

0 commit comments

Comments
 (0)