thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Passing constant “is_training” to BN for better performance #983

Open JoursBleu opened 5 years ago

JoursBleu commented 5 years ago

Darkflow uses slim BN. For now, it passes "is_training" parameter to slim BN as a tensor. This introduce many control flow ops, which seriously limited the performance. My tests shows that, if passing a constant "is_training", we can get 12.7% performance improvement on NVIDIA P100 and 40% performance improvement on Intel Xeon Platinum 8180. (cfg/yolo-voc.cfg, Pascal VOC2007, BS 16)