xuebinqin / U-2-Net

The code for our newly accepted paper in Pattern Recognition 2020: "U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection."
Apache License 2.0
8.52k stars 1.47k forks source link

BCELoss was unstable so just get logits from model and use BCEwithLog… #309

Open deshwalmahesh opened 2 years ago

deshwalmahesh commented 2 years ago

Changes according to Performance Tuning: Official docs

  1. Use bias = False in Line 9 of model of u2net.py
  2. Line 67-69: Usetorch.backends.cudnn.benchmark = Trueand use Mixed Precision Training
  3. Use BceWithLogitLoss : Line 29 in place of BCELoss of `training
  4. Return logits as d0-d6 in place of Sigmoids: Line 525 of u2net.py
  5. Set torch.backends.cudnn.benchmark = True : Line 69 of training