ValueError: setting an array element with a sequence.

img


state = np.reshape(state,(1,4))
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

img


此为直接输出还没有reshape的state

https://blog.csdn.net/Poo_Chai/article/details/91040938
https://pythonjishu.com/numpy-error/

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^