无法使用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)
您只能将其重塑为8,8阵列。 8×8 = 64个
尝试:
some_digit = X[880]
some_digit_image = some_digit.reshape(8, 8)