train_dataset = dsets.CIFAR100(root=’…/…/data/’,
train=True,
transform=transform,
download=True)
images, labels = train_dataset[0]
…
images = Variable(image.cuda())               # error!
labels = Variable(label.cuda())
outputs = resnet(images)
loss = criterion(outputs, labels)
I want to convert it to a net inputs, and calc net’s gradients
How to convert image to Variable?
thanks