for labels,images in dataloader:
if not torch.is_tensor(images):
print("image not in tensors",type(images))
continue
images = images.to(device)
just make sure that labels and images in for loop are in correct order and also debug like that