tensorflow-yolov3
tensorflow-yolov3 copied to clipboard
change hyperparameter of yolov3 for custom dataset
I have trained yolov3 for face detection with WIDER face dataset. I want to detect small faces. When I trained with pretrained weight from coco dataset the loss was too high, it was 24.14 and after 14 epoch the training loss became NaN. Then I trained again from scratch without pretrained weight. This time training loss was 14.34 and after 30 epoch loss became NaN. I didn't change anything in config.py
, Somehow the loss function is not improving as expected. Could you please guide me how can tune these parameters for my dataset so that loss can be improved and will not become NaN? My training image size is around 1024x800. Do I need to resize my training set?
hello, @sabrinatuli I have exactly the same problem. did you solve it? what i should change in my config file?
I am no more working in tensorflow, you can check pytorch or keras.
On Thu, Nov 28, 2019, 5:40 PM Kerolos ghobrial [email protected] wrote:
hello, @sabrinatuli https://github.com/sabrinatuli I have exactly the same problem. did you solve it? what i should change in my config file?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/YunYang1994/tensorflow-yolov3/issues/351?email_source=notifications&email_token=ACZJSCQVFUOIP23I2WDXRS3QV6G2RA5CNFSM4JCT3MH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFMAZMY#issuecomment-559418547, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJSCVFOWKNDBIXINO72ILQV6G2RANCNFSM4JCT3MHQ .
@kerolos @sabrinatuli
Try this solution, it will resolve the Train NAN issue, however for me, test loss is still NAN from start till end. but the model works fine when I test after training.
在yolo3.py的bbox_giou上改两处: iou = inter_area / tf.maximum(union_area, 1e-12) giou = iou - 1.0 * (enclose_area - union_area) / tf.maximum(enclose_area, 1e-12) 在yolo3.py的bbox_iou上改一处: iou = 1.0 * inter_area / tf.maximum(union_area, 1e-12) 亲测再也没有出现Nan的问题
thanks @MuhammadAsadJaved . Will try it.