|
|
@ -39,6 +39,7 @@ import six
|
|
|
|
import scipy.io as scio
|
|
|
|
import scipy.io as scio
|
|
|
|
from paddle.dataset.image import *
|
|
|
|
from paddle.dataset.image import *
|
|
|
|
from paddle.reader import *
|
|
|
|
from paddle.reader import *
|
|
|
|
|
|
|
|
from paddle import compat as cpt
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import numpy as np
|
|
|
|
import numpy as np
|
|
|
|
from multiprocessing import cpu_count
|
|
|
|
from multiprocessing import cpu_count
|
|
|
@ -126,9 +127,11 @@ def reader_creator(data_file,
|
|
|
|
batch = pickle.load(f)
|
|
|
|
batch = pickle.load(f)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
batch = pickle.load(f, encoding='bytes')
|
|
|
|
batch = pickle.load(f, encoding='bytes')
|
|
|
|
data = batch[six.b('data')]
|
|
|
|
if batch is not None:
|
|
|
|
labels = batch[six.b('label')]
|
|
|
|
batch = cpt.to_text(batch)
|
|
|
|
for sample, label in zip(data, batch[six.b('label')]):
|
|
|
|
data = batch['data']
|
|
|
|
|
|
|
|
labels = batch['label']
|
|
|
|
|
|
|
|
for sample, label in zip(data, batch['label']):
|
|
|
|
yield sample, int(label) - 1
|
|
|
|
yield sample, int(label) - 1
|
|
|
|
if not cycle:
|
|
|
|
if not cycle:
|
|
|
|
break
|
|
|
|
break
|
|
|
|