1

I am pretty new to YOLO/Darknet and am walking in circles with the solutions. I have looked at the Github and Stackexchange fora pages corresponding with similar issues, but none seems to directly address this output issue (i.e. where the region IOU line is missing). Here is my output (training/testing):

enter image description here

Here is my directory structure: enter image description here

Other details:

  • I am using the AlexeyAB fork.
  • 6 classes in total (following this convention of annotating occluded and truncated items, so two "items" with three classes each)
  • I'm using 200+ training images (definitely too few, but I don't know if this is the root cause of my troubles).
  • There is no predictions.png, just predictions.jpg. However, I don't think this should be an issue.
  • I followed this tutorial.

Any help is very much appreciated; thank you in advance!

eurieka
  • 181
  • 1
  • 6
  • Tiny Yolo is small so it's normal that it trains your dataset quickly. What do you mean by different ouput? I can't really see your image because its too small – gameon67 Apr 25 '19 at 00:15
  • Oh sorry! The output (from the “train” command) reads: loading weights from cola_test/yolov3-tiny.weights... seen 64 Done! Learning Rate: 0.001, Momentum: 0.9, Decay: 0.005 Saving weights to backup//cola_yolov3_tiny_final.weights. – eurieka Apr 25 '19 at 07:35
  • This is odd to me (no “Region Avg IOU”) and then from the “test” command it looks fine but says: “Not compiles with OpenCV, saving to predictions.png instead” (but it’s a jpg with no bounding boxes) – eurieka Apr 25 '19 at 07:37
  • Did you compile darknet with OpenCV? If no bounding box is drawn it means your prediction is failed and probably your model is still not good enough. How did you train your model? Until what iteration and what's the avg loss? – gameon67 Apr 25 '19 at 07:41
  • Plus, you have 200 images for 6 classes? I guess 200 images for 1 class is okay, but 200 / 6 = 33 is too few – gameon67 Apr 25 '19 at 07:43
  • No OpenCV. What do you mean by “how” I trained it? Are you talking about what I put in the cfg file? How do I find the number of iterations (max batches = 12000?) and I didn’t know the average loss. And I know that there’s far too few photos :( . All photos were manually generated and labeled, so I just want to know if I’m doing anything else wrong before I go and generate more for the training set). – eurieka Apr 25 '19 at 11:22
  • Update: I got a -nan avg loss, 0.000000 rate (when running the answer (from @Kaito Einstein) below. – eurieka Apr 25 '19 at 13:21
  • Have you read the documentation made by Alexey? He explains everything on his github. When you train the model, on command prompt, you can see the avg loss of each iteration – gameon67 Apr 26 '19 at 00:02
  • I did. Originally I didn't have any of that output, which is why I didn't have information for any of the iterations. Average loss for each iteration ended up being over 300 though. – eurieka Apr 26 '19 at 21:26
  • 1
    avg loss 300 is so high. Wait until more than 2.000 iterations, and also as I said, adding more images per class will help – gameon67 Apr 27 '19 at 00:37

1 Answers1

2

If it finish too soon on training, try adding -clear 1at the end of your training command.

EDIT: This is the correct answer (ergo why I accepted it), but lacks an explanation. The "-clear 1" flag is, according to this answer, clears past stats.

eurieka
  • 181
  • 1
  • 6
Abdeslem SMAHI
  • 453
  • 2
  • 12