diff --git a/python/paddle/fluid/layers/io.py b/python/paddle/fluid/layers/io.py index 03788b41cb2db1283e0e4d628266a7c02e82c079..149b33334a8c26060bb7c9dd29b87dc22e4420b0 100644 --- a/python/paddle/fluid/layers/io.py +++ b/python/paddle/fluid/layers/io.py @@ -520,7 +520,7 @@ def py_reader(capacity, shapes, dtypes, lod_levels=None, name=None): startup_var = startup_blk.create_var(name=reader_name) startup_blk.append_op( type='create_py_reader', - inputs={'blocking_queue': queue_name}, + inputs={'blocking_queue': [queue_name]}, outputs={'Out': [startup_var]}, attrs={ 'shape_concat': shape_concat, diff --git a/python/paddle/fluid/tests/demo/pyreader.py b/python/paddle/fluid/tests/demo/pyreader.py index 9fddef3c24f1eb71d4da4562856934c640a1e2a2..cc459a8f761672ff6ccddfc2ff55f04a3969d1e2 100644 --- a/python/paddle/fluid/tests/demo/pyreader.py +++ b/python/paddle/fluid/tests/demo/pyreader.py @@ -15,6 +15,7 @@ import paddle.fluid as fluid import paddle.dataset.mnist as mnist import paddle +import paddle.v2 import threading import numpy @@ -91,7 +92,8 @@ def main(): for epoch_id in xrange(10): train_data_thread = pipe_reader_to_queue( - paddle.batch(mnist.train(), 32), train_queue) + paddle.batch(paddle.v2.reader.firstn(mnist.train(), 32), 64), + train_queue) try: while True: print 'train_loss', numpy.array(