I am new to Pytorch. I am using a pre-trained model (RESNET-50). And i am trying to train this model on MS-COCO dataset using cocoapi.
I have loaded my dataset images and annotations in train loader.
for epoch in range (epochs):
   for images,labels in train_loader:
         print(type(images))
         print(type(labels))
         print(images.size())
         print(images.dim())
         steps+=1
         images, labels = images.to(device), labels.to(device)

I got the following output:
<class ‘torch.Tensor’>
<class ‘list’>
torch.Size([64, 3, 224, 224])
4
And i got this Error: I think it is because labels is not a Tensor?

error1280×960 118 KB

Can anyone help me with this? Thanks