MemoryError:无法为形状为(1189469420,)和数据类型为int64的数组分配8.86 GiB

时间:2020-05-17 20:36:23

标签: python memory anaconda out-of-memory

我有Windows10 / 64位,并且在Anaconda上运行代码

我试图用两个数据之一运行模糊匹配代码,其中一个数据为19343行×24列,另一个数据为501428行×30列,这是代码:

MemoryError: Unable to allocate 8.86 GiB for an array with shape (1189469420,) and data type int64

大约10分钟后出现内存错误:

import struct
print(struct.calcsize("P") * 8)

在Anaconda环境中,它说python版本是3.7.7,但我不知道如何注意到Python是32位还是64位,我提到后者是因为我读到有时会发生此错误,因为Python是32位,操作系统为64位,反之亦然。 我感谢任何可能的答案!

编辑: 所以我尝试了 {{1}} 并返回64,表示python正在运行64位,那么关于内存错误的问题是什么?

0 个答案:

没有答案