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

Loss converge but test fail #1141

Open yamiefun opened 4 years ago

yamiefun commented 4 years ago

I'm training tiny yolo for one class detection. At the end of training, loss converges to about 0.7, which seems great. But when I test the trained network with some images picked from training dataset, it still detect nothing. I use the command below and I'm not sure if I load the trained weights correctly?

$ flow --model cfg/my-yolo.cfg --load -1 --imgdir images/

I've tried --threshold 0.1 but nothing is detected either. Thanks very much.

JABBeeson commented 4 years ago

Are you sure the data set you are feeding is correctly annotated?

yamiefun commented 4 years ago

Yeah im quite sure. How can I print out the things that detected by yolo during training? I wonder why the training loss can be that small but still detected nothing when testing.

JABBeeson commented 4 years ago

If you are testing against images used in the dataset and it doest detect anything the issue is isolated to the learning. I have no idea what to suggest other than to follow this guide: https://medium.com/coinmonks/detecting-custom-objects-in-images-video-using-yolo-with-darkflow-1ff119fa002f On another note, have you tried training using a pre-existing cfg file to get you started? (like tiny-yolo)

arthurfortes commented 4 years ago

Try first overfitting your network with 3 or 5 images (until you obtain >90% of confidence in this examples (1000 epochs its sufficient)). After, you use the last ckpt and all images to train your network again.