Skip to content

Commit d8384c8

Browse files
committed
Polish code
test=develop
1 parent 5ae34fb commit d8384c8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/paddle/dataset/flowers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import functools
3636
from .common import download
3737
import tarfile
38-
import six
3938
import scipy.io as scio
4039
from paddle.dataset.image import *
4140
from paddle.reader import *
@@ -45,7 +44,6 @@
4544
from multiprocessing import cpu_count
4645
import six
4746
from six.moves import cPickle as pickle
48-
from six.moves import zip
4947
__all__ = ['train', 'test', 'valid']
5048

5149
DATA_URL = 'http://paddlemodels.cdn.bcebos.com/flowers/102flowers.tgz'
@@ -127,11 +125,11 @@ def reader():
127125
batch = pickle.load(f)
128126
else:
129127
batch = pickle.load(f, encoding='bytes')
130-
if batch is not None:
128+
if six.PY3:
131129
batch = cpt.to_text(batch)
132130
data = batch['data']
133131
labels = batch['label']
134-
for sample, label in zip(data, batch['label']):
132+
for sample, label in six.moves.zip(data, batch['label']):
135133
yield sample, int(label) - 1
136134
if not cycle:
137135
break

0 commit comments

Comments
 (0)