criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(cnn.parameters(), lr=LR)
for epoch in range(EPOCH):
for i, (img_name,img_label) in enumerate(train_loader):
images = Variable(img_name).cuda()
labels = Variable(img_label).cuda()
optimizer.zero_grad()
outputs = cnn(images)
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
print(i)
   print("===> Epoch[{}/{}]({}/{}): Loss: {:.4f}".format(epoch+1,EPOCH, i, len(train_loader), loss.data[0]))