无法将大小为64的数组重塑为形状(28,28) [英] cannot reshape array of size 64 into shape (28,28)

查看:190
本文介绍了无法将大小为64的数组重塑为形状(28,28)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法使用Sklean重塑mnist数据集中的图像 这是我的代码的开始部分,只需加载数据

Not able to reshape the image in mnist dataset using sklean This is the starting portion of my code just load the data

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数组. 8x8 = 64

You can only reshape it into a 8, 8 array. 8x8=64

这篇关于无法将大小为64的数组重塑为形状(28,28)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆