无法使用Sklean重塑mnist数据集中的图像 这是我的代码的开始部分,只需加载数据
some_digit = X[880]
some_digit_image = some_digit.reshape(28, 28)
错误部分
ValueError Traceback (most recent call last)
<ipython-input-15-4d618bdb57bc> in <module>
1 some_digit = X[880]
----> 2 some_digit_image = some_digit.reshape(28,28)
ValueError: cannot reshape array of size 64 into shape (28,28)
答案 0 :(得分:1)
您只能将其重塑为8、8阵列。 8x8 = 64
答案 1 :(得分:0)
尝试:
some_digit = X[880]
some_digit_image = some_digit.reshape(8, 8)