0
我试图重塑的(1397,2)numpy的数组转换成(1397,50,50,20,1)。该阵列具有2列的Python:重塑3D图像的numpy的阵列和标签
each row in column1 is of length: 50*50*20 [3D image]
each row in column2 is of lenght : 2 [labels : [0,1],[1,0]].
基本上试图解开3D图像的第一列以馈送到CNN中的输入层。
到目前为止我的代码
np.array([i[0] for i in data]).reshape(-1,50,50,20,1)
给我一个错误:
"ValueError: cannot reshape array of size 1397 into shape (50,50,20,1)"
任何帮助是极大的赞赏
干杯 罗宾
第一列是Tensorflow对象吗? – amirbar
不,只是一个50 * 50 * 20的numpy阵列 –
这个数组的'dtype'是什么?如果'data'具有像这样的混合列,它可以是对象dtype,结构化数组或列表而不是数组。我们需要准确的说明。 – hpaulj