草庐IT

inhomogeneous

全部标签

YOLOv5训练过程中遇到该问题的解决方法ValueError: The requested array has an inhomogeneous shape after 1 dimensions

YOLOv5训练时遇到问题ValueError:settinganarrayelementwithasequence.Therequestedarrayhasaninhomogeneousshapeafter1dimensions.可以参考以下解决方案问题分析:数组append时前后数组的shape不一致,当时我在自己遇到问题时也没有找到解决方法,最后发现是训练集中有一个图片名字太长导致读不到东西,里面插了一个none值从而导致shape不一致(数据是从roboflow下的,没有检查)。解决方法:先debug到出问题那行,接着看shape,找到值none对应的图片(也就是出错的那张图),再到训