Hi! I’m trying to fine-tune some network, like vgg, alexnet, resnet, to meet with my dataset.
input: image, ByteTensor(3×200×200)
output: hot vector of labels, ByteTensor(1×98)
I checked the transfer learning tutorial (http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html 3)
and changed the last layer and the calculation part with resnet18 as follows, but the error is happened.
#model change
train_resnet = models.resnet18(pretrained=True)
num_ftrs = pretrain_resnet.fc.in_features
pretrain_resne.fc = nn.Liear(num_ftrs,98)
#forward + backward + optimize
m = nn.LogSoftmax()
outputs = pretrain_resnet(inputs)
_, preds = torch.max(outputs.data,1)
loss = criterion(m(outputs), labels)

#error
outputs = pretrain_resnet(inputs)
→RuntimeError:  expexted Byte tensor (got Float tensor)

Best regards,
hana