Haochen-Wang409 / U2PL

[CVPR'22] Semi-Supervised Semantic Segmentation Using Unreliable Pseudo-Labels
Apache License 2.0
426 stars 59 forks source link

About calculating 'thres' in unsupervised loss. #103

Closed DISAPPEARED13 closed 1 year ago

DISAPPEARED13 commented 1 year ago

Hi there. I found that the code in computing unsupervised loss: thresh = np.percentile(entropy[target != 255].detach().cpu().numpy().flatten(), percent)

And, sometimes, my network will generate all-zero output, should I just add a try-except to skip calculating unsupervised loss? Or it's just because some bugs in code?

Thanks a lot.

Haochen-Wang409 commented 1 year ago

We define sup_only_epoch in our experiments, which means during these epochs, only supervised loss is backpropagated. Therefore, unsupervised loss and contrastive loss are expected to be zero at the beginning.