最近在看《PyTorch深度学习实战》,看到11章 Mnist手写数字图像识别其中加载mnist数据的时候,报错,仔细对着看了一遍发现是images = np.fromfile(imgpath, dtype=np.uint8).reshape(len(labels),)这行代码有问题,应该改为images = np.fromfile(imgpath, dtype=np.uint8).reshape(len(labels),784)就可以了。
ValueError: cannot reshape array of size 47040000 into shape (60000,)
最新推荐文章于 2023-09-13 16:49:19 发布