change cls_target to clas_target

pull/608/head
zuchen.wang 2021-10-12 10:52:37 +08:00
parent 1bd41a79fc
commit d2ee44d503
2 changed files with 5 additions and 5 deletions

View File

@ -194,15 +194,15 @@ def pair_batch_collator(batched_inputs):
images = []
targets = []
cls_targets = []
clas_targets = []
for elem in batched_inputs:
images.append(elem['img1'])
images.append(elem['img2'])
targets.append(elem['target'])
cls_targets.append(elem['cls_target'])
clas_targets.append(elem['clas_target'])
images = torch.stack(images, dim=0)
targets = torch.tensor(targets)
cls_targets = torch.tensor(cls_targets)
return {'images': images, 'targets': targets, 'cls_targets': cls_targets}
cls_targets = torch.tensor(clas_targets)
return {'images': images, 'targets': targets, 'clas_targets': clas_targets}

View File

@ -46,7 +46,7 @@ class PairDataset(Dataset):
'img1': img1,
'img2': img2,
'target': label,
'cls_target': idx
'clas_target': idx
}
@property