【发布时间】:2017-09-16 10:49:19
【问题描述】:
大家好,
我有一个生成矩阵的 python 进程。它们相互堆叠并保存为张量。这是代码
import tables
h5file = tables.open_file("data/tensor.h5", mode="w", title="tensor")
atom = tables.Atom.from_dtype(n.dtype('int16'))
tensor_shape = (N, 3, MAT_SIZE, MAT_SIZE)
for i in range(N):
mat = generate(i)
tensor[i, :, :] = mat
问题是当它达到 8GB 时内存不足。 HDF5格式不应该永远不会出现内存不足吗?就像在需要时将数据从内存移动到磁盘?
【问题讨论】:
标签: python hdf5 pytables bigdata