vignywang / IDC

Exploring Intrinsic Discrimination and Consistency for Weakly Supervised Object Localization
Other
2 stars 1 forks source link

miss definition #3

Open XR-2020 opened 3 months ago

XR-2020 commented 3 months ago

Thank you very much for the code provided by the author, but I ran into some problems at runtime, self.gen_grid was missing in the vgg_CUB.py or res_CUB.py : grid_n = self.gen_grid(-1,1,-1,1,h,w) . What is self.gen_grid? Can you provide it? Thanks.

akhilgakhar commented 3 months ago

I assume that a similar code segment is written in the train.py file: line 74

def gen_grid(h_min, h_max, w_min, w_max, len_h, len_w): x, y = torch.meshgrid([torch.linspace(w_min, w_max, len_w), torch.linspace(h_min, h_max, len_h)]) grid = torch.stack((x, y), -1).transpose(0, 1).reshape(-1, 2).float().cuda() return grid