From 374867d1ae791761952916cf0993cb717213ca43 Mon Sep 17 00:00:00 2001 From: liaogang Date: Wed, 8 Mar 2017 19:54:28 +0800 Subject: [PATCH] Fix python code --- image_classification/README.en.md | 7 +++---- image_classification/README.md | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/image_classification/README.en.md b/image_classification/README.en.md index 97079e5..a331929 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 829e99a..f880c9d 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) ``` -- GitLab