transforms.FiveCrop : the size of labels mismatches with the size of inputs

I was trying to use transforms.FiveCrop, say I set the batch_size to 1.

The following is my code


transform = transforms.Compose([
            transforms.Resize(224),
            transforms.RandomHorizontalFlip(),
            transforms.RandomVerticalFlip(),
            transforms.FiveCrop((224,224)),
            transforms.Lambda(lambda crops: torch.stack([transforms.ToTensor()(crop) for crop in crops])),

data = torchvision.datasets.ImageFolder('./data/SIW-13-train-test/test/', transform=transform)

loader = torch.utils.data.DataLoader(data, batch_size=1)

inputs, labels = loader

Then the size of inputs becomes (1L, 5L, 3L, 224L, 224L), but the size of labels is still (1L,)

and here is the error information

RuntimeError: invalid argument 2: mismatch between the batch size of input (5) and that of target (1) at /opt/conda/conda-bld/pytorch_1518243271935/work/torch/lib/THCUNN/generic/ClassNLLCriterion.cu:39

So how can I solve this problem?