import torch as t from torch.utils import data import os from PIL import Image import numpy as np import torchvision.transforms as T transforms = T.Compose([ T.Resize(224), T.CenterCrop(224), T.ToTensor(), T.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)) ]) # 继承Dataset类要重写__getitem__