frank-xwang / RIDE-LongTailRecognition

[ICLR 2021 Spotlight] Code release for "Long-tailed Recognition by Routing Diverse Distribution-Aware Experts."
MIT License
261 stars 26 forks source link

[Error] An error that may cause the "reweight" flag to fail #23

Closed ChenWendi2001 closed 2 years ago

ChenWendi2001 commented 3 years ago

Hi, I got some errors in the class RIDELoss() in loss.py. It seems that if I set the "reweight" flag of loss to be false in the configuration file, there would be an AttributeError which says 'RIDELoss' object has no attribute 'per_cls_weights_base'. I think you may set self.per_cls_weights_base to be None when self.reweight_epoch == -1 in the function _hook_before_epoch() to solve this problem.

frank-xwang commented 3 years ago

Thanks for your suggestions, we will look into it.