添加大量边时 iGraph Python 中的内存错误
Memory error in iGraph Python when adding large number of edges
关于此线程:http://goo.gl/uEyFua
我在尝试导入大型图表时遇到了与以下代码非常相似的问题:
for (edge_id) in cursorSQL:
L.add((edge_id[2], str(edge_id[1])))
g = igraph.Graph.TupleList(L)
我收到以下错误:
Traceback (most recent call last):
File "C.py", line 707, in __getitem__ return self._ids[item]
KeyError: '184840900'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
g = igraph.Graph.TupleList(L)
File "C:\Python34\lib\site-packages\igraph\__init__.py", line 2473, in TupleList
edge_list.append((idgen[item[0]], idgen[item[1]]))
File "C:\Python34\lib\site-packages\igraph\datatypes.py", line 709, in __getitem__
self._ids[item] = next(self._generator)
MemoryError
只是为了说清楚。此代码可以完美运行,直到边数太大(~400 万。)
谢谢。
切换到 python-64 位,问题现已解决。
问题是 win7 中 python-32 位的每个进程 2GB 的限制。
关于此线程:http://goo.gl/uEyFua
我在尝试导入大型图表时遇到了与以下代码非常相似的问题:
for (edge_id) in cursorSQL:
L.add((edge_id[2], str(edge_id[1])))
g = igraph.Graph.TupleList(L)
我收到以下错误:
Traceback (most recent call last):
File "C.py", line 707, in __getitem__ return self._ids[item]
KeyError: '184840900'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
g = igraph.Graph.TupleList(L)
File "C:\Python34\lib\site-packages\igraph\__init__.py", line 2473, in TupleList
edge_list.append((idgen[item[0]], idgen[item[1]]))
File "C:\Python34\lib\site-packages\igraph\datatypes.py", line 709, in __getitem__
self._ids[item] = next(self._generator)
MemoryError
只是为了说清楚。此代码可以完美运行,直到边数太大(~400 万。)
谢谢。
切换到 python-64 位,问题现已解决。
问题是 win7 中 python-32 位的每个进程 2GB 的限制。