MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况,不要担心,办法很简单,解决办法如下:

MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

1.引起此类问题的原因是电脑虚拟内存占用太大,因此只需要修改电脑的虚拟内存,此类问题即可迎刃而解。

##下面是修改虚拟内存的办法:
2.打开系统属性;在命令窗口输入编辑环境变量如图所示,点击编辑环境变量。![在这里插入图片描述](https://img-blog.****img.cn/20200219203839554.pngMemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

2.进入编辑环境变量,如图所示;

MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

3.进入设置,上图虚拟内存的设置,进入性能选项,如下图所示;

MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

4.点击更改进入下面图示虚拟内存(注意对应,你要错了)

MemoryError: Unable to allocate array with shape (60000, 28, 28) and data type float 32等类似情况

5.根据自己的电脑,修改相应的配置即可,最后点击设置然后一直点击确定即可。

6最后回到所要运行的程序,问题就被解决了,如果依然出现问题,可以尝试关机重启电脑。