【发布时间】:2021-10-30 08:20:18
【问题描述】:
您好,我有一个 80x60 的 32FC1 图像的数据集,我正在做的是重塑数据集以对其进行转换和标记,以便它可以用于训练 CNN,但是当我重塑我的数据集时,我得到以下错误:
arraynegativos= ds_negatives.reshape(( n_negatives_img, img_width, img_height))
arraypositivos= ds_positives.reshape((n_positives_img, img_width, img_height))
AttributeError: 'list' object has no attribute 'reshape'
所以我将我的 ds_negative 转换为 numpy 数组,如下所示:
ds_negatives1 = np.array(ds_negatives)
但它给了我这个错误:
cannot reshape array of size 1 into shape (26308,80,60)
所以现在我有点困惑,我如何将我的数据集转换成这样?
这里是脚本的链接,这样你可以更好地看到它。
https://colab.research.google.com/drive/1KzoHXA8Y6lcyvq7K7segFfJp2AIw9P45?usp=sharing
【问题讨论】:
标签: python numpy tensorflow machine-learning keras