大きな hdf5 ファイル (寸法 1kk x 1k) で flannを使用しようとしています。
しかし、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'