无法使用sklearn重塑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