I have a dataset where each image can have 14 labels. So i have converted labels of each image to format [0,1,0,0,1,0,0,1,0,0,0,1,1,0] and trying to apply BCEWithLogitsLoss.
inputs should come from NN and target  is 14 label list.
like below

def getitem(self, idx):
if torch.is_tensor(idx):
idx = idx.tolist()
img_path = self.img_list[idx][0]
image = Image.open(img_path).convert(‘RGB’)
if self.transform:
image = self.transform(image)
#sample = {‘img’: image,
#          ‘label’: self.img_list[idx][1]}
#return sample
label = self.img_list[idx][1]
return image,label

##############  Training function

outputs = model(inputs)
loss = criterion(outputs, labels)   ----> error line

Kindly suggest how to train multi label classifier if i am doing wrong