We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8551e07 commit 5ae34fbCopy full SHA for 5ae34fb
python/paddle/dataset/flowers.py
@@ -39,6 +39,7 @@
39
import scipy.io as scio
40
from paddle.dataset.image import *
41
from paddle.reader import *
42
+from paddle import compat as cpt
43
import os
44
import numpy as np
45
from multiprocessing import cpu_count
@@ -126,9 +127,11 @@ def reader():
126
127
batch = pickle.load(f)
128
else:
129
batch = pickle.load(f, encoding='bytes')
- data = batch[six.b('data')]
130
- labels = batch[six.b('label')]
131
- for sample, label in zip(data, batch[six.b('label')]):
+ if batch is not None:
+ batch = cpt.to_text(batch)
132
+ data = batch['data']
133
+ labels = batch['label']
134
+ for sample, label in zip(data, batch['label']):
135
yield sample, int(label) - 1
136
if not cycle:
137
break
0 commit comments