ProposalContrast icon indicating copy to clipboard operation
ProposalContrast copied to clipboard

[Bug?] in forward_ssl

Open Hiusam opened this issue 3 years ago • 0 comments

Hi Junbo,

In your forward_ssl code, you squeeze the fps sampling sequence, but this will raise errors when the batch size is 1 because you index the fps_choice with the batch index afterward.

    fps_choice = pointnet2_batch_utils.furthest_point_sample(
            points_overlap_org.contiguous(), self.npoints
        ).long().squeeze()

        # compute correspondence
        for kk in range(batch_size):
            key_idx = example['overlap'][kk][fps_choice[kk]].type(torch.float32)
            example['correspondence'][kk] = torch.min(torch.abs(torch.sub(key_idx.unsqueeze(dim=-1),example['correspondence'][kk].unsqueeze(dim=0).type(torch.float32))),dim=-1)[1]

Hiusam avatar Oct 25 '22 03:10 Hiusam