一般报这个错是因为把numpy的array当成list来使用了。 解决办法:把array变量转化为list。 import numpy as np myArray = np.array(**) ...... #看这里 myArray = myArray.tolist() ......