解决python-报错----ValueError: setting an array element with a sequence.

在训练模型时,系统报错,出现如下情况:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.

 然而检查数据集、环境配置参数发现没有问题,相同的模型、配置和训练数据集在其他电脑上可以正常训练。

解决方案:更换了numpy版本和Python版本,从原来的python3.10和numpy1.24.3替换为python3.9 与numpy1.22.3,即可顺利训练