fix subtle eval bug
@@ -182,8 +182,8 @@ class VseppCaptionAgent(TorchAgent):
images = images.cuda(async=True)
# Need to collate then sort the captions by length
- cands = [self.candidate_helper(label_cands_vec, batch.candidates[idx], self.mode=='test')
- for label_cands_vec, idx in zip(batch.candidate_vecs, batch.valid_indices)]
+ cands = [self.candidate_helper(label_cands_vec, label_cands, self.mode=='test')
+ for label_cands_vec, label_cands in zip(batch.candidate_vecs, batch.candidates)]
self.model.eval()
# Obtain the image embeddings
img_embs, _ = self.model(images, None, None)
