AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.66k stars 7.96k forks source link

What is the best way to draw train/valid loss chart? #58

Open CemalAker opened 7 years ago

CemalAker commented 7 years ago

In your detailed tutorial on training for own dataset, you mention about early stopping in order to avoid over-fitting. Is there any easy way to obtain the train/valid loss chart? The only way that I can imagine is getting the weights from several iterations and computing loss for them. But this is a tiresome approach.

AlexeyAB commented 7 years ago

@ZetilenZoe

There is no any way to do this. Because you should do valid for each images of validation-dataset to get average IoU.

To simplify, I suggest looking at the current indicator avg loss, that much less accurate, but visible immediately. And only when decreasing of avg loss stoped, then you should do valid.

phongnhhn92 commented 7 years ago

I have the same problem but I want to draw it after training. Is there any way, I can see all the log file after training finished ?

sivagnanamn commented 6 years ago

Everyone who has used other Deep learning frameworks like TensorFlow, Keras etc are used to checking train & validation error during training.

To simplify, I suggest looking at the current indicator avg loss, that much less accurate, but visible immediately. And only when decreasing of avg loss stoped, then you should do valid.

@AlexeyAB It would be helpful if you could elaborate the reason behind the above statement. Thank you.

AlexeyAB commented 6 years ago

@sivagnanamn It's just not implemented yet in the Darknet. So if you can implement it in the source code - yes it will be convenient.

Also an accurate definition of the loss during validation must occur throughout the valuation sample. Otherwise, this indicator is inaccurate.

sivagnanamn commented 6 years ago

@AlexeyAB Thank you very much for your response.

I had a look at the loss calculation part during training. The avg_loss is computed heuristically.

avg_loss = avg_loss*.9 + loss*.1;

Is there any intuition behind this way of averaging the loss? Should validation loss also be calculated the same way?