File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
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 *
41
+ from paddle import compat as cpt
42
42
import os
43
43
import numpy as np
44
44
from multiprocessing import cpu_count
45
45
import six
46
46
from six .moves import cPickle as pickle
47
- from six .moves import zip
48
47
__all__ = ['train' , 'test' , 'valid' ]
49
48
50
49
DATA_URL = 'http://paddlemodels.cdn.bcebos.com/flowers/102flowers.tgz'
@@ -126,9 +125,11 @@ def reader():
126
125
batch = pickle .load (f )
127
126
else :
128
127
batch = pickle .load (f , encoding = 'bytes' )
128
+ if six .PY3 :
129
+ batch = cpt .to_text (batch )
129
130
data = batch ['data' ]
130
131
labels = batch ['label' ]
131
- for sample , label in zip (data , batch ['label' ]):
132
+ for sample , label in six . moves . zip (data , batch ['label' ]):
132
133
yield sample , int (label ) - 1
133
134
if not cycle :
134
135
break
You can’t perform that action at this time.
0 commit comments