Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about some bugs in you code #1

Open
rorschach-xiao opened this issue Oct 14, 2021 · 2 comments
Open

about some bugs in you code #1

rorschach-xiao opened this issue Oct 14, 2021 · 2 comments

Comments

@rorschach-xiao
Copy link

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?

@peterkim333
Copy link

same problem.

@fnzhan
Copy link
Owner

fnzhan commented Mar 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants