Python ValueError:无法将输入数组从形状(150528,1)广播到形状(150528)

Python ValueError:无法将输入数组从形状(150528,1)广播到形状(150528),python,python-3.x,opencv,Python,Python 3.x,Opencv,我正在尝试将数组复制到矩阵以填充行,如下所示: image = cv2.imread(file) feature = image.reshape((IMAGE_LEN, -1)) features_matrix[0] = np.copy(feature[0:]) 但是得到以下错误: ValueError: could not broadcast input array from shape (150528,1) into shape (150528) 特征矩阵是用大小合适的np.ze

我正在尝试将数组复制到矩阵以填充行,如下所示:

image = cv2.imread(file)    
feature = image.reshape((IMAGE_LEN, -1))
features_matrix[0] = np.copy(feature[0:])
但是得到以下错误:

ValueError: could not broadcast input array from shape (150528,1) into shape (150528)
特征矩阵是用大小合适的np.zerosNUM每个标签、图像、文件构建的

和功能[0:]或功能[0::]适合此大小

print (feature.shape) gives (150528,1)
那么问题出在哪里?我该如何解决


我正在使用Python3.7

尝试图像。重塑图像长度

执行功能[0::]与功能[0::]相同的错误,然后您应该告诉我们有关形状的更多信息。。