Please check if your ‘__ getitem __()’ function from the torch.utils.data.Dataset class returns a dictionary. ( Something similar to what’s given below.)
{
‘images’ : ____ ,
‘landmarks’ : ____,
}
if that is the keys, instead of images = images.cuda(), use
images = dict.get(‘images’) where dict refers to the dictionary returned at each iteration.