小编akr*_*a81的帖子

出现错误:无法将大小为122304的数组重塑为形状(52,28,28)

我正在尝试将numpy数组重塑为:

data3 = data3.reshape((data3.shape[0], 28, 28))
Run Code Online (Sandbox Code Playgroud)

在哪里data3

[[54 68 66 ..., 83 72 58]
 [63 63 63 ..., 51 51 51]
 [41 45 80 ..., 44 46 81]
 ..., 
 [58 60 61 ..., 75 75 81]
 [56 58 59 ..., 72 75 80]
 [ 4  4  4 ...,  8  8  8]]
Run Code Online (Sandbox Code Playgroud)

data3.shape(52, 2352 )

但是我一直收到以下错误:

ValueError: cannot reshape array of size 122304 into shape (52,28,28)
Exception TypeError: TypeError("'NoneType' object is not callable",) in <function _remove at …
Run Code Online (Sandbox Code Playgroud)

python numpy image-processing reshape cv2

6
推荐指数
1
解决办法
5万
查看次数

标签 统计

cv2 ×1

image-processing ×1

numpy ×1

python ×1

reshape ×1