Scanning labels data_train/2/labels.cache (2960 found, 0 missing, 1 empty, 0 duplicate, for 2961 images): 2961it [00:00, 12423.43it/s]
Traceback (most recent call last):
File "train.py", line 461, in <module>
train(hyp, opt, device, tb_writer)
File "train.py", line 173, in train
mlc = np.concatenate(dataset.labels, 0)[:, 0].max()
File "<__array_function__ internals>", line 5, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 5 and the array at index 1 has size 6
使用 np.concatenate 拼接dataset.labels 的时候,要求每一张图的标签不能为空,否则会报出上述dimension问题
2960 found, 0 missing, 1 empty, 0 duplicate, for 2961 image
中 1 empty 即表示其中有一个张图片中标签为空,将空标签的图片剔除即可