【问题标题】:FLANN and big HDF5 fileFLANN 和大 HDF5 文件
【发布时间】:2014-02-26 06:06:09
【问题描述】:

我正在尝试将flann 与大 hdf5 文件(尺寸 1kk x 1k)一起使用。

但在 flann_example.cpp 中的功能全部失败

Matrix<float> dataset;
load_from_file(dataset, "carray.hdf5", "carray");

上线

dataset = flann::Matrix<T>(new T[dims_out[0]*dims_out[1]], dims_out[0], dims_out[1]);

因为它似乎想用new分配大内存块

我用的是2Gb的win32,有没有办法处理这么大的数据?

我也试过python

def using_pyflann():
    N=10000*6  # for 100k x 1k don't work
    dim=1000
    type=np.int32  #int8 can't be used?
    x = np.array(np.random.rand(N, dim)*10, dtype=type)
    perm = np.random.permutation(N)
    fl= FLANN()
    fl.build_index(x)
    pt= np.array(np.random.rand(1, dim)*10, dtype=type)
    t0= time.time()
    res, dist= fl.nn_index(pt)
    print (time.time()-t0)
    print res
    print dist
    print 'done'

【问题讨论】:

  • 恐怕你得逐篇阅读。

标签: c++ hdf5 nearest-neighbor knn flann


【解决方案1】:

如果没有特别的原因,你必须使用win32解决方案平台,你应该切换到x64平台。在 Win32 平台上,您不能分配超过 2GB 的内存。

https://software.intel.com/en-us/articles/memory-limits-applications-windows

【讨论】:

    猜你喜欢
    • 2011-07-17
    • 2016-01-28
    • 2013-05-28
    • 2018-06-26
    • 2015-05-09
    • 2011-12-21
    • 2013-12-12
    • 2013-01-23
    • 2023-03-24
    相关资源
    最近更新 更多