jiaw-z / FCStereo

[CVPR'22] Revisiting Domain Generalized Stereo Matching Networks from a Feature Consistency Perspective
MIT License
53 stars 3 forks source link

About the Stereo Selective Whitening Loss. #8

Open Zhaohuai-L opened 1 year ago

Zhaohuai-L commented 1 year ago

Hi , Thanks a lot for your great work,I mitigated SSW and SCF to my own Project with similar backbone. But the SSW loss is a NAN, so I debuged it and found it's 'num_sensitive_sum' being zero after ‘mask_matrix’ multiplied by self.reversal_eye. Even if I set 'num_sensitive_sum' to 0.0001 , the SWW loss becomes zero too.

Is there a bug here or am I understanding it wrong?

            mask_matrix = mask_matrix.view(B, -1)
            for midx in range(B):
                mask_matrix[midx][indices] = 1
            mask_matrix = mask_matrix.view(B, self.dim, self.dim)
            mask_matrix = mask_matrix * self.reversal_eye
            num_sensitive_sum = torch.sum(mask_matrix)
            if num_sensitive_sum==0:
                num_sensitive_sum=0.0001
jiaw-z commented 1 year ago

Sorry to reply late. num_sensitive_sum sums the number of pixels that are sensitive to viewpoint changes. In our experiments, we did not observe cases in that num_sensitive_sum equals zero. And it is not proper to set num_sensitive_sum to 0.0001 as it is an integer.

Zhaohuai-L commented 1 year ago

Ok, thanks for your reply.