diff --git a/image_classification/README.en.md b/image_classification/README.en.md index 97079e5ebebe48d196f62f51478e15cb480b0dc1..a3319293e85019f43311ed7b71b8926c3328b92f 100644 --- a/image_classification/README.en.md +++ b/image_classification/README.en.md @@ -368,7 +368,7 @@ where $n$ is the number of processed samples, $lr_{0}$ is the learning_rate. `cifar.train10()` will yield records during each pass, after shuffling, a batch input is generated for training. ```python -reader=paddle.reader.batch( +reader=paddle.batch( paddle.reader.shuffle( paddle.dataset.cifar.train10(), buf_size=50000), batch_size=128) @@ -397,10 +397,9 @@ def event_handler(event): sys.stdout.flush() if isinstance(event, paddle.event.EndPass): result = trainer.test( - reader=paddle.reader.batch( + reader=paddle.batch( paddle.dataset.cifar.test10(), batch_size=128), - reader_dict={'image': 0, - 'label': 1}) + feeding=feeding) print "\nTest with Pass %d, %s" % (event.pass_id, result.metrics) ``` diff --git a/image_classification/README.md b/image_classification/README.md index 829e99a2b9cb9819d87df9bfc53dd81f1a2a6147..f880c9d01530cb2d0ac0dc03e7b1c23fff48ca6b 100644 --- a/image_classification/README.md +++ b/image_classification/README.md @@ -375,7 +375,7 @@ $$ lr = lr_{0} * a^ {\lfloor \frac{n}{ b}\rfloor} $$ cifar.train10()每次产生一条样本,在完成shuffle和batch之后,作为训练的输入。 ```python -reader=paddle.reader.batch( +reader=paddle.batch( paddle.reader.shuffle( paddle.dataset.cifar.train10(), buf_size=50000), batch_size=128) @@ -402,10 +402,9 @@ def event_handler(event): sys.stdout.flush() if isinstance(event, paddle.event.EndPass): result = trainer.test( - reader=paddle.reader.batch( + reader=paddle.batch( paddle.dataset.cifar.test10(), batch_size=128), - reader_dict={'image': 0, - 'label': 1}) + feeding=feeding) print "\nTest with Pass %d, %s" % (event.pass_id, result.metrics) ```