Closed ptvu281 closed 2 years ago
Hi @yiheng-wang-nv ,
Could you please help confirm this question and provide some comments?
Thanks in advance.
Hi @ptvu281 ,
the error means:
negatives_mask.shape[1] = 8
, and torch.exp(sim_matrix / temperature_tensor).shape[1] = 4
,
where negatives_mask.shape[1]
equals to self.batch_size * 2
,
torch.exp(sim_matrix / temperature_tensor).shape[1]
equals to input.shape[1] + target.shape[1]
, these two values should be the same.
As shown in this line,
could you please try to print the shape of flat_out_v1
and flat_out_v2
, and what is the batch size you set?
Discussed in https://github.com/Project-MONAI/tutorials/discussions/581