提交 23447cd5 编写于 作者: M minqiyang

Fix parallel_executor_fetch_feed issue

上级 5d4238cd
...@@ -116,8 +116,8 @@ def reader_creator(data_file, ...@@ -116,8 +116,8 @@ def reader_creator(data_file,
for file in open(file_list): for file in open(file_list):
file = file.strip() file = file.strip()
batch = None batch = None
with open(file, 'r') as f: with open(file, 'rb') as f:
batch = pickle.load(f) batch = pickle.loads(f.read())
data = batch['data'] data = batch['data']
labels = batch['label'] labels = batch['label']
for sample, label in zip(data, batch['label']): for sample, label in zip(data, batch['label']):
......
...@@ -29,6 +29,7 @@ import os ...@@ -29,6 +29,7 @@ import os
import unittest import unittest
import numpy as np import numpy as np
import paddle.reader.creator import paddle.reader.creator
import six
class TestNumpyArray(unittest.TestCase): class TestNumpyArray(unittest.TestCase):
...@@ -37,7 +38,7 @@ class TestNumpyArray(unittest.TestCase): ...@@ -37,7 +38,7 @@ class TestNumpyArray(unittest.TestCase):
x = np.array(l, np.int32) x = np.array(l, np.int32)
reader = paddle.reader.creator.np_array(x) reader = paddle.reader.creator.np_array(x)
for idx, e in enumerate(reader()): for idx, e in enumerate(reader()):
self.assertItemsEqual(e, l[idx]) six.assertCountEqual(e, l[idx])
class TestTextFile(unittest.TestCase): class TestTextFile(unittest.TestCase):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册