File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 35
35
import functools
36
36
from .common import download
37
37
import tarfile
38
- import six
39
38
import scipy .io as scio
40
39
from paddle .dataset .image import *
41
40
from paddle .reader import *
45
44
from multiprocessing import cpu_count
46
45
import six
47
46
from six .moves import cPickle as pickle
48
- from six .moves import zip
49
47
__all__ = ['train' , 'test' , 'valid' ]
50
48
51
49
DATA_URL = 'http://paddlemodels.cdn.bcebos.com/flowers/102flowers.tgz'
@@ -127,11 +125,11 @@ def reader():
127
125
batch = pickle .load (f )
128
126
else :
129
127
batch = pickle .load (f , encoding = 'bytes' )
130
- if batch is not None :
128
+ if six . PY3 :
131
129
batch = cpt .to_text (batch )
132
130
data = batch ['data' ]
133
131
labels = batch ['label' ]
134
- for sample , label in zip (data , batch ['label' ]):
132
+ for sample , label in six . moves . zip (data , batch ['label' ]):
135
133
yield sample , int (label ) - 1
136
134
if not cycle :
137
135
break
You can’t perform that action at this time.
0 commit comments