Open xinslu opened 2 years ago
On Putting Multiple Print Statements I was able to single out the error:
I ran out this code:
import faiss
import numpy as np
d = 64 # dimension
nb = 100000 # database size
nq = 10000 # nb of queries
np.random.seed(1234) # make reproducible
xb = np.random.random((nb, d)).astype('float32')
xb[:, 0] += np.arange(nb) / 1000.
xq = np.random.random((nq, d)).astype('float32')
xq[:, 0] += np.arange(nq) / 1000.
index = faiss.IndexFlatL2(d) # build the index
print(index.is_trained)
index.add(xb) # add vectors to the index
print(index.ntotal)
print("Done")
k = 4 # we want to see 4 nearest neighbors
D, I = index.search(xb[:5], k) # sanity check
print("Done???")
print(I)
print(D)
D, I = index.search(xq, k) # actual search
print(I[:5]) # neighbors of the 5 first queries
print(I[-5:]) # neighbors of the 5 last queries
The Second Done Statement doesn't get printed and there is a Segmentation Fault Error so it fails on searching.
any update?
Summary
Platform
OS:
macOS Monterey 12.0.1 (M1, 2020)
Faiss version: 1.7.2
Installed from:
Compiled from Source
Faiss compilation options:
cmake -B build . -DFAISS_ENABLE_PYTHON=ON, -DBUILD_TESTING=ON, -DFAISS_ENABLE_GPU=OFF
Running on:
Interface:
Reproduction instructions
I build the code using CMake and saved it on the directory I am working on and running all other related code from. Test Session Result: ``` ============================= test session starts ============================== platform darwin -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /Users/kinshukphalke/Documents/Notitia/faiss collecting 5 items Fatal Python error: Aborted Current thread 0x0000000100bd8580 (most recent call first): File "/Users/kinshukphalke/Documents/Notitia/faiss/build/faiss/python/build/lib/faiss/swigfaiss.py", line 9236 in omp_set_num_threads File "/Users/kinshukphalke/Documents/Notitia/faiss/tests/common_faiss_tests.py", line 15 in