0

I trained YOLOv3 via the Darknet framework. Every 1000 iteration it saved the weights but at the end, Darknet evaluates all the weights, and uses the best. They are saved in a separate file "yolov3_best.weights".

I want to find out, which iteration was used for this file. I tried so far:

  • use the weights in a recognition test via terminal and checked the output
  • opened the best.weights-file via Editor and searched for it

but I couldn't find it.

Does anyone have a solution?

Thanks upfront.

mirArnold
  • 121
  • 2
  • 11

2 Answers2

1

so, it is not clear how to find out which iteration step / epoch was used for the best_weights-file, so I did the following:

I wrote a script, which uses the "yolov3_best.weights"-file to detect all classes in the testset, compared that with my label-data and calculated the metrics recall, precision and f1. I did this also for all the other weights, that darknet saves by default (every 1000 iteration steps) and compared the results of.

At the end I found out, that the "yolov3_best.weights" is not the best for my metrics, so I choose the one with the highest recall value (but others may choose according to the metric that has to be optimized for the case neccessary).

Hope this helpes others.

mirArnold
  • 121
  • 2
  • 11
0

From AlexeyAB wiki there are two ways of doing this

  1. Test the various weights in backup/ using the map recall flag.

    Example: ./detector map data/obj.data yolo-obj.cfg backup/yolo-obj_7000.weights

    Do this for all the weights and pick one with the highest mAP (mean average precision) or IoU (intersect over union)

  2. Train with the -map flag

    Example: ./detector detector train data/obj.data yolo-obj.cfg yolov4.conv.137 -map

    mAP will be calculated for every 4 Epochs using valid=valid.txt file that is specified in data/obj.data

Rex Mudanya
  • 189
  • 2
  • 8