Solution to the problem of not loading labels in the verification set during YOLOv5 training

        In the process of using the YOLOv5 training data set, there may be situations where the training set or verification set labels are not loaded, resulting in failure to train. Regarding the inability to load labels in the training set, Franpper proposed a possible reason in a previous blog. For details, see the solution to the undetectable problem when using YOLOv5 to detect large aspect ratios (slender targets) https://blog.csdn .net/weixin_58283091/article/details/128441085?spm=1001.2014.3001.5501

        Next, Franpper will introduce a possible reason why the verification set cannot load labels .

        In YOLOv5, the k-means clustering algorithm is used to generate anchor boxes that are more in line with the current data set . The specific generation method Franpper will introduce to you later. In short, this algorithm will finally return 9 anchor boxes of different sizes by counting the size of the marked boxes in the data set. anchor. If the annotation frame in the data set is not enough to support the clustering algorithm to generate the anchor, the anchor with the default size will be used, as shown in the figure below:

        Then the problem comes, when using the anchor of the default size, if the target in your own data set is very different from these pre-selected boxes (such as a slender target), Labels cannot be generated during verification during training, of course Scores cannot be calculated, nor can normal training be performed. As shown below:

        How to solve this problem? Most of the reasons for this problem are that the sizes of the label boxes in the data set are very close and there are several fixed-size label boxes, especially when using the method of copying and pasting the label boxes during the labeling process . This problem can be solved by simply adjusting the size of the label box after copying and pasting the label box for a period of time during the labeling process so that the size of the label box in the final dataset is varied.

        I wish everyone success! ! !

Guess you like

Origin blog.csdn.net/weixin_58283091/article/details/130088234