hnswlib
hnswlib copied to clipboard
Is that my file.txt wrong?
`import numpy as np import hnswlib
start = time() num_elements, dim = 500000, 128 INDEX = hnswlib.Index(space="cosine", dim=128) INDEX.init_index(max_elements=num_elements, ef_construction=200, M=16)
data = np.loadtxt("./item_vec.txt") item_id = data[:, 0].astype(int) item_vec = data[:, 1:] INDEX.add_items(item_vec,item_id) print("index cost time:%s" % (time() - start))`
The program always crash, and after Ctrl+Z, progress still remain, I have to kill -9 pid
also can't work on python client
Hi @zhengkai215, I cannot reproduce it, it finishes in 0.75 seconds. I wonder, what python version are you using? Did you install it via pip? Does it work without the ids?