criterion = nn.CrossEntropyLoss().cuda()
optimizer = optim.SGD(model.parameters(), lr=0.1, momentum=.9, nesterov = True,weight_decay=5e-4)
modelp=torch.nn.DataParallel(model, device_ids=[0,1,2]).cuda()
modelp = train_model(modelp, criterion, optimizer,num_epochs=1)
batch_size=5
RuntimeError: invalid argument 2: mismatch between the batch size of input (500) and that of target (5) at /opt/conda/conda-bld/pytorch_1503970438496/work/torch/lib/THCUNN/generic/ClassNLLCriterion.cu:41