xyupeng / ContrastiveCrop

[CVPR 2022 Oral] Crafting Better Contrastive Views for Siamese Representation Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

some question about bbox_update

lenka844 opened this issue · comments

commented

hello, i've tried use your work on my dataset, and it made work, too.But when i try to enlarge my dataset, there is a problem occured: when the model train to 200 or 300epochs, the box update always failed, i try to figure out the reason, found that when the process going to update, the heat_map tensor is empty, i was confused how to solve this problem and does this occured by my dataset size? because when i use small dataset, this problem dosent happend.

What do you mean by "the heatmap is empty"? Could you provide some more details? In principle, the dataset size does not affect box update.

commented

What do you mean by "the heatmap is empty"? Could you provide some more details? In principle, the dataset size does not affect box update.

well,thanks for replying, the error reminds "IndexError: index is out of bounds for dimension with size 0",and i locate where it happends, that is in the DDP_simsiam_ccrop.py line 120, ' h_min, h_max = torch.nonzero(h_filter).view(-1)[[0, -1]] / Hi # [h_min, h_max]; 0 <= h <= 1',
this part code is
`for hmap in eval_train_map:
print('=============',hmap)
hmap = hmap.squeeze(0) # (Hi, Wi)

        h_filter = (hmap.max(1)[0] > t).int()
        w_filter = (hmap.max(0)[0] > t).int()
        h_min, h_max = torch.nonzero(h_filter).view(-1)[[0, -1]] / Hi  # [h_min, h_max]; 0 <= h <= 1
         w_min, w_max = torch.nonzero(w_filter).view(-1)[[0, -1]] / Wi  # [w_min, w_max]; 0 <= w <= 1
        boxes.append(torch.tensor([h_min, w_min, h_max, w_max]))``

i think is the hmaps' problem, so i print the hmap, and found the hmap is empty, but when i use small dataset, hmap is not empty, that is confusing.

Does this happen upon the first update? The only possibility I can come up with is the input image is too small (ie, <32). Note that even if the box size = (0, 0) does not affect sampling and inference.

commented

Does this happen upon the first update? The only possibility I can come up with is the input image is too small (ie, <32). Note that even if the box size = (0, 0) does not affect sampling and inference.

Thanks for your reply, I will check it carefully again.