RABIT icon indicating copy to clipboard operation
RABIT copied to clipboard

about some bugs in you code

Open rorschach-xiao opened this issue 3 years ago • 2 comments

Hi zhan, I appreciate your work so much! However , I met some bugs when I tried to use your code.

1、models/networks/correspondence.py (line 385)

       elif self.opt.warp_mask_losstype == 'cycle':
            # f_div_C_v = F.softmax(f_WTA.transpose(1, 2), dim=-1)
            f_WTA_v = f.transpose(1, 2)
            f_div_C_v = f_WTA_v / f_WTA_v.sum(-1).view(-1, N, 1)

            seg = F.interpolate(seg_map, scale_factor=1 / self.down, mode='nearest')
            channel = seg.shape[1]
            seg = seg.view(batch_size, channel, -1)
            seg = seg.permute(0, 2, 1)
            warp_mask_to_ref = torch.matmul(f_div_C_v, seg)  # 2*1936*channel
            warp_mask = torch.matmul(f_div_C, warp_mask_to_ref)  # 2*1936*channel
            warp_mask = warp_mask.permute(0, 2, 1).contiguous()
            coor_out['warp_mask'] = warp_mask.view(batch_size, channel, feat_height, feat_width)  # 2*3*44*44

'f' and 'f_div_C' is not defined

2、models/networks/generator.py (line 47)

     self.conv_img1 = nn.Conv2d(1, seg, 3, padding=1)
     self.up = nn.Upsample(scale_factor=2)

'seg' is not defined

would you please fix these bugs?

rorschach-xiao avatar Oct 14 '21 03:10 rorschach-xiao

same problem.

peterkim333 avatar Mar 07 '22 01:03 peterkim333

Seems you set --warp_mask_losstype cycle in training, you may follow the default setting of --warp_mask_losstype direct

I have corrected the bug in generator.py

fnzhan avatar Mar 08 '22 15:03 fnzhan