The solution to the problem encountered during YOLOv5 training ValueError: The requested array has an inhomogeneous shape after 1 dimensions

YOLOv5 encountered problems during training ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. You can refer to the following solutions

Problem Analysis: The shape of the array before and after the array append is inconsistent. At that time, I did not find a solution when I encountered the problem. Finally, I found that there was a picture in the training set whose name was too long and could not read anything. A none value was inserted in it, which caused the shape to be inconsistent (the data was downloaded from roboflow and was not checked).

Solution: first debug to the line with the problem, then look at the shape, find the picture corresponding to the value none (that is, the picture with the error), then go to the training set folder, modify the name of the corresponding picture, and run it again to solve the problem.

 

 

 

Guess you like

Origin blog.csdn.net/weixin_48778017/article/details/128433984