LongxingTan / tfyolo

tfyolo: Efficient Implementation of Yolov5 in TensorFlow
229 stars 71 forks source link

Learning rate scheduler not updated in train_step #12

Open Darkhunter9 opened 3 years ago

Darkhunter9 commented 3 years ago

My tensorflow version is 2.1.0. I found that when calling step() of the learning rate scheduler, lr is not updated (the scheduler works fine when tested individually). I guess it has something to do with distributed strategy run process. The problem is fixed if moving the learning rate updating process to the main loop, instead of in training step function.

https://github.com/LongxingTan/Yolov5/blob/88acfd988decc4cc78335cfb6eb50f1975294c1f/yolo/train.py#L122

LongxingTan commented 3 years ago

Hi @Darkhunter9 , Thanks for your carefully check about the code. you found so many bug and kindly give solutions, I will check that. Thanks