#加载飞桨和相关类库 import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear import numpy as np import os from PIL import Image import random import matplotlib.pyplot as plt %matplotlib inline
defdata_loader():for index,data inenumerate(train_reader()):if index==0:img=np.array([x[0]for x in(data)]).astype('float32')label=np.array([x[1]for x in(data)]).astype('float32')print('batch_images_shape:{}'.format(img.shape))print('one_image_shape:{}'.format(img[0].shape))print('label_shape:{}'.format(label.shape))return img,label