标签:
转载自https://stackoverflow.com/questions/48373228/valueerror-could-not-broadcast-input-array-from-shape-25-1-into-shape-25
通过几个例子简单了解一下:
Here’s an example of the error:
>>> a = [np.zeros((224,224,3)), np.zeros((224,224,3)), np.zeros((224,224))]
>>> np.array(a)
ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
or, different type of input, but the same error:
>>> a = [np.zeros((224,224,3)), np.zeros((224,224,3)), np.zeros((224,224,13))]
>>> np.array(a)
Traceback (most recent call last):
File "", line 1, in
ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
Alternatively, similar but with a different error message:
>>> a = [np.zeros((224,224,3)), np.zeros((224,224,3)), np.zero